Examples of IdentityPersistenceManager


Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

     * @param userId
     * @return
     */
    public boolean isXmppSettingsEnabled(String userId){
        try {
            IdentityPersistenceManager persistenceManager =  IdentityPersistenceManager
                    .getPersistanceManager();
            return persistenceManager.isXmppSettingsEnabled(IdentityTenantUtil.getRegistry(), userId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

        return false;
    }

    public boolean hasXMPPSettings(String userId){
        try {
            IdentityPersistenceManager persistenceManager =  IdentityPersistenceManager
                    .getPersistanceManager();
            return persistenceManager.hasXMPPSettings(IdentityTenantUtil.getRegistry(), userId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

                                                         realmService.getTenantManager().
                                                                      getTenantId(domainName),
                                                         domainName, "Info card login");
        } else {
            // external parties
            IdentityPersistenceManager persistentManager =
                                                           IdentityPersistenceManager.
                                                                                      getPersistanceManager();
            if (persistentManager.hasSignedUpForOpenId(registry, userRealm, openID.getOpenID())) {
                user = persistentManager.getUserIdForOpenIDSignUp(registry, userRealm,
                                                                  openID.getOpenID());
                if (userRealm.getUserStoreManager().isExistingUser(user)) {
                    CarbonAuthenticationUtil.onSuccessAdminLogin(httpSess,
                                                                 user,
                                                                 realmService.getTenantManager().getTenantId(domainName),
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

                                                              RegistryException, CarbonException {
        String username = null;
        Registry registry = null;
        String tenantDomain = TenantUtils.getTenantDomainFromRequestURL(requestURI);
        registry = IdentityTenantUtil.getRegistry(tenantDomain, null);
        IdentityPersistenceManager manager = IdentityPersistenceManager.getPersistanceManager();
        username = manager.getUserByPPID(registry, ppid);
        return username;
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

                                                           UserMgtConstants.EXECUTE_ACTION);
                    userStore.addRole(IdentityConstants.IDENTITY_DEFAULT_ROLE, null,
                                      new Permission[] { permission });
                }
                userStore.addUser(username, password, new String[]{IdentityConstants.IDENTITY_DEFAULT_ROLE}, null, null);
                IdentityPersistenceManager manager = IdentityPersistenceManager.getPersistanceManager();
                registry = IdentityRPServiceComponent.getRegistryService().getConfigSystemRegistry(tenantId);
                manager.doOpenIdSignUp(registry, userRealm, openId.getOpenID(), username);
                this.addUserClaims(username, firstName, lastName, email, tenantId);
            }
           
//            MessageContext msgCtx = MessageContext.getCurrentMessageContext();
//
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

     * @return
     * @throws IdentityException
     * @throws RegistryException
     */
    private boolean doOpenIDSignUp(String userName, String openId) throws Exception {
        IdentityPersistenceManager manager = IdentityPersistenceManager.getPersistanceManager();
        String domain = TenantUtils.getDomainNameFromOpenId(openId);
        Registry registry = IdentityTenantUtil.getRegistry(domain, userName);
        UserRealm realm = IdentityTenantUtil.getRealm(domain, userName);
        return manager.doOpenIdSignUp(registry, realm, openId, userName);
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

    private final static Log log = LogFactory.getLog(STSAdminService.class);

    public CardIssuerDTO readCardIssuerConfiguration() throws Exception {
        CardIssuerDTO dto = null;
        IdentityPersistenceManager dbAmin = null;
        ParameterDO param = null;
        ArrayList<CardIssuerTokenDTO> supportedTokens = null;
        String[] tokens = null;
        Registry registry = null;

        dbAmin = IdentityPersistenceManager.getPersistanceManager();
        dto = new CardIssuerDTO();
        registry = IdentityTenantUtil.getRegistry();

        supportedTokens = new ArrayList<CardIssuerTokenDTO>();
        param = dbAmin.getParameter(registry, IdentityConstants.PARAM_SUPPORTED_TOKEN_TYPES);

        if (param == null || param.getValue() == null) {
            addParameters(registry);
            param = dbAmin.getParameter(registry, IdentityConstants.PARAM_SUPPORTED_TOKEN_TYPES);
        }

        if (param != null && param.getValue() != null) {
            tokens = param.getValue().split(",");
            CardIssuerTokenDTO token = null;
            for (int i = 0; i < tokens.length; i++) {
                token = new CardIssuerTokenDTO();
                if (tokens[i].trim().length() > 0) {
                    token.setTokenType(getTokenType(tokens[i]));
                    token.setSupported(true);
                    supportedTokens.add(token);
                }
            }
        }

        param = dbAmin.getParameter(registry, IdentityConstants.PARAM_NOT_SUPPORTED_TOKEN_TYPES);
        if (param != null && param.getValue() != null) {
            tokens = param.getValue().split(",");
            CardIssuerTokenDTO token = null;
            for (int i = 0; i < tokens.length; i++) {
                if (tokens[i].trim().length() > 0) {
                    token = new CardIssuerTokenDTO();
                    token.setTokenType(getTokenType(tokens[i]));
                    token.setSupported(false);
                    supportedTokens.add(token);
                }
            }
        }

        dto.setSupportedTokenTypes(supportedTokens.toArray(new CardIssuerTokenDTO[supportedTokens
                .size()]));

        param = dbAmin.getParameter(registry, IdentityConstants.PARAM_CARD_NAME);
        if (param != null && param.getValue() != null) {
            dto.setCardName(param.getValue());
        }

        param = dbAmin.getParameter(registry, IdentityConstants.PARAM_VALID_PERIOD);
        if (param != null && param.getValue() != null) {
            dto.setValidPeriodInDays(Integer.parseInt(param.getValue()));
        }

        param = dbAmin.getParameter(registry, IdentityConstants.PARAM_USE_SYMM_BINDING);
        if (param != null && param.getValue() != null) {
            if ("true".equals(param.getValue())) {
                dto.setSymmetricBinding(true);
            } else {
                dto.setSymmetricBinding(false);
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

        return dto;
    }

    public void updateCardIssueConfiguration(CardIssuerDTO issuer) throws Exception {
        IdentityPersistenceManager dbAmin = null;
        CardIssuerTokenDTO[] supportedTokens = null;
        StringBuffer supportedBuffer = null;
        StringBuffer notSupportedBuffer = null;

        dbAmin = IdentityPersistenceManager.getPersistanceManager();

        supportedTokens = issuer.getSupportedTokenTypes();
        supportedBuffer = new StringBuffer();
        notSupportedBuffer = new StringBuffer();

        for (int i = 0; i < supportedTokens.length; i++) {
            if (supportedTokens[i].isSupported()) {
                supportedBuffer.append(getUri(supportedTokens[i].getTokenType()));
            } else {
                notSupportedBuffer.append(getUri(supportedTokens[i].getTokenType()));
            }
        }

        Registry registry = null;
        registry = IdentityTenantUtil.getRegistry();

        dbAmin.createOrUpdateParameter(registry, IdentityConstants.PARAM_SUPPORTED_TOKEN_TYPES,
                supportedBuffer.toString());
        dbAmin.createOrUpdateParameter(IdentityTenantUtil.getRegistry(),
                IdentityConstants.PARAM_NOT_SUPPORTED_TOKEN_TYPES, notSupportedBuffer.toString());
        dbAmin.createOrUpdateParameter(registry, IdentityConstants.PARAM_CARD_NAME, issuer
                .getCardName());
        dbAmin.createOrUpdateParameter(registry, IdentityConstants.PARAM_VALID_PERIOD, String
                .valueOf(issuer.getValidPeriodInDays()));
        dbAmin.createOrUpdateParameter(registry, IdentityConstants.PARAM_USE_SYMM_BINDING, String
                .valueOf(issuer.isSymmetricBinding()));
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

            return uri;
        }
    }

    private void addParameters(Registry registry) throws IdentityException {
        IdentityPersistenceManager admin = IdentityPersistenceManager.getPersistanceManager();

        admin.createOrUpdateParameter(registry, IdentityConstants.PARAM_SUPPORTED_TOKEN_TYPES,
                IdentityConstants.SAML10_URL + "," + IdentityConstants.SAML11_URL + ","
                        + IdentityConstants.SAML20_URL + "," + IdentityConstants.OpenId.OPENID_URL);

        admin.createOrUpdateParameter(registry, IdentityConstants.PARAM_CARD_NAME,
                IdentityConstants.PARAM_VALUE_CARD_NAME);
        admin.createOrUpdateParameter(registry, IdentityConstants.PARAM_VALID_PERIOD,
                IdentityConstants.PARAM_VALUE_VALID_PERIOD);
    }
View Full Code Here

Examples of org.wso2.carbon.identity.core.persistence.IdentityPersistenceManager

            if (ppidValue != null) {
                String user = null;
                // we only allow self issued for tenant 0
                try {
                    IdentityPersistenceManager manager = IdentityPersistenceManager
                            .getPersistanceManager();
                    user = manager.getUserByPPID(IdentityTenantUtil.getRegistry(null, null), ppidValue);
                } catch (Exception e) {
                    log.error(e.getMessage(), e);
                    throw new IdentityProviderException("Cannot retrieve username because "+e.getMessage(), 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.