Examples of XMPPSettingsDO


Examples of org.wso2.carbon.identity.core.model.XMPPSettingsDO

     */
    public XMPPSettingsDTO getXmppSettings(String userId){
        XMPPSettingsDTO xmppSettingsDTO = null;
        try {
            IdentityPersistenceManager persistenceManager =  IdentityPersistenceManager.getPersistanceManager();
            XMPPSettingsDO xmppSettingsDO = persistenceManager.getXmppSettings(IdentityTenantUtil.getRegistry(), userId);
            xmppSettingsDTO = new XMPPSettingsDTO();
            xmppSettingsDTO.setXmppServer(xmppSettingsDO.getXmppServer());
            xmppSettingsDTO.setXmppUserName(xmppSettingsDO.getXmppUserName());
            xmppSettingsDTO.setUserCode(xmppSettingsDO.getUserCode());
            xmppSettingsDTO.setXmppEnabled(xmppSettingsDO.isXmppEnabled());
            xmppSettingsDTO.setPINEnabled(xmppSettingsDO.isPINEnabled());

        } catch (Exception e) {
             log.error("Error when instantiating the Persistence Manager.", e);
        }

View Full Code Here

Examples of org.wso2.carbon.identity.core.model.XMPPSettingsDO

        IdentityPersistenceManager persistenceManager = IdentityPersistenceManager
                .getPersistanceManager();
        domainName = TenantUtils.getDomainNameFromOpenId(openID);
        tenantUser = UserCoreUtil.getTenantLessUsername(userName);

        XMPPSettingsDO xmppSettingsDO = persistenceManager.getXmppSettings(IdentityTenantUtil
                .getRegistry(domainName, userName), tenantUser);
        isAutheticated = IdentityTenantUtil.getRealm(domainName, userName).getUserStoreManager()
                .authenticate(tenantUser, password);

        // attempts to do multi-factor authentication, if the user has enabled it.
        if (xmppSettingsDO != null && xmppSettingsDO.isXmppEnabled() && isAutheticated) {
            MPAuthenticationProvider mpAuthenticationProvider = new MPAuthenticationProvider(
                    xmppSettingsDO);
            authenticationStatus = mpAuthenticationProvider.authenticate();
            if (log.isDebugEnabled()) {
                log.debug("XMPP Multifactor Authentication was completed Successfully.");
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.XMPPSettingsDO

    public boolean doXMPPBasedMultiFactorAuthForInfocard(String userId) throws Exception {
        boolean authenticationStatus = true;

        IdentityPersistenceManager persistenceManager = IdentityPersistenceManager
                .getPersistanceManager();
        XMPPSettingsDO xmppSettingsDO = persistenceManager.getXmppSettings(IdentityTenantUtil
                .getRegistry(null, userId), UserCoreUtil.getTenantLessUsername(userId));

        // attempts to do multi-factor authentication, if the user has enabled
        // it.
        if (xmppSettingsDO != null && xmppSettingsDO.isXmppEnabled()) {
            MPAuthenticationProvider mpAuthenticationProvider = new MPAuthenticationProvider(
                    xmppSettingsDO);
            authenticationStatus = mpAuthenticationProvider.authenticate();
        }
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.XMPPSettingsDO

     * @param resource
     * @return
     */
    protected XMPPSettingsDO resourceToObject(Resource resource) {

        XMPPSettingsDO xmppSettingsDO = null;

        if (resource != null) {
            xmppSettingsDO = new XMPPSettingsDO();
            xmppSettingsDO.setXmppServer(resource
                    .getProperty(IdentityRegistryResources.XMPP_SERVER));
            xmppSettingsDO.setXmppUserName(resource
                    .getProperty(IdentityRegistryResources.XMPP_USERNAME));
            xmppSettingsDO.setUserCode(resource
                    .getProperty(IdentityRegistryResources.XMPP_USERCODE));

            if (resource.getProperty(IdentityRegistryResources.XMPP_ENABLED).trim().equals("true")) {
                xmppSettingsDO.setXmppEnabled(true);
            } else {
                xmppSettingsDO.setXmppEnabled(false);
            }

            if (resource.getProperty(IdentityRegistryResources.XMPP_PIN_ENABLED).trim().equals(
                    "true")) {
                xmppSettingsDO.setPINEnabled(true);
            } else {
                xmppSettingsDO.setPINEnabled(false);
            }
        }

        return xmppSettingsDO;
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.XMPPSettingsDO

     * @param userId
     * @return
     */
    public XMPPSettingsDO getXmppSettings(String userId) {

        XMPPSettingsDO xmppSettings = null;

        try {
            if (registry.resourceExists(IdentityRegistryResources.XMPP_SETTINGS_ROOT + userId)) {
                xmppSettings = resourceToObject(registry
                        .get(IdentityRegistryResources.XMPP_SETTINGS_ROOT + userId));
View Full Code Here

Examples of org.wso2.carbon.identity.core.model.XMPPSettingsDO

     * @return
     */
    public boolean isXmppSettingsEnabled(String userId) {

        boolean isEnabled = false;
        XMPPSettingsDO xmppSettings;
        try {
            if (registry.resourceExists(IdentityRegistryResources.XMPP_SETTINGS_ROOT + userId)) {
                xmppSettings = resourceToObject(registry
                        .get(IdentityRegistryResources.XMPP_SETTINGS_ROOT + userId));
                isEnabled = xmppSettings.isXmppEnabled();
            }
        } catch (RegistryException e) {
            log.error("Error when checking the availability of the user " + userId, e);
        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.