Examples of IdentityPersistenceManager


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

        boolean authenticationStatus = true;
        boolean isAutheticated = false;
        String domainName = null;
        String tenantUser = null;

        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.
View Full Code Here

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

            // if domain is null then check for the super tenant
            registry = IdentityTenantUtil.getRegistry(null, null);
        } else {
            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

                    policySet[0].setValue("false");
                }
            }

            if (policySet[1].getValue().equals("true")) {
                IdentityPersistenceManager identityPersistentManager = IdentityPersistenceManager
                        .getPersistanceManager();
                InfoCardDAO infoCardDAO = new InfoCardDAO(registry);

                if ((infoCardDAO.getInfoCardsForUser(username).length > 0)
                        || (identityPersistentManager.hasXMPPSettings(registry, tenatUser) && identityPersistentManager
                                .isXmppSettingsEnabled(registry, tenatUser))) {

                    if (infoCardDAO.getInfoCardsForUser(tenatUser).length > 0) {
                        policySet[2].setValue("true");
                    }

                    if (identityPersistentManager.hasXMPPSettings(registry, tenatUser)
                            && identityPersistentManager.isXmppSettingsEnabled(registry, tenatUser)) {
                        policySet[3].setValue("true");
                    }
                } else {
                    policySet[1].setValue("false");
                }
View Full Code Here

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

     * @throws Exception
     */
    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()) {
View Full Code Here

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

    }

    private void storeCard(InformationCard card, String tenantAwareUserName)
            throws IdentityProviderException {

        IdentityPersistenceManager dbman = null;
        InfoCardDO cardDo = null;

        try {
            dbman = IdentityPersistenceManager.getPersistanceManager();
        } catch (Exception e) {
            throw new IdentityProviderException(e.getMessage(), e);
        }

        cardDo = new InfoCardDO();
        cardDo.setCardId(card.getInformationCardReference().getCardId());
        cardDo.setDateIssued(card.getTimeIssued());
        cardDo.setUserId(tenantAwareUserName);
        cardDo.setDateExpires(card.getTimeExpires());
        cardDo.setOpenIDInfoCard(this.isOpenIdInfoCard);

        try {
            cardDo.setInfoCard(card.serialize());
        } catch (CardModelException e) {
            throw new IdentityProviderException(e.getMessage(), e);
        }

        try {
            dbman.createInfoCard(IdentityTenantUtil.getRegistry(), cardDo);
        } catch (Exception e) {
            throw new IdentityProviderException(e.getMessage(), e);
        }

        log.info("Information card details stored for card id : "
View Full Code Here

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

    private boolean isValidCard(String cardId, Registry registry) throws IdentityProviderException {
        if (log.isDebugEnabled()) {
            log.debug("Begin Validating card.");
        }
        boolean retval = false;
        IdentityPersistenceManager dbman = null;
        InfoCardDO card = null;

        try {
            dbman = IdentityPersistenceManager.getPersistanceManager();
            card = dbman.getInfoCard(registry, cardId);
        } catch (IdentityException e) {
            throw new IdentityProviderException(e.getMessage(), e);
        }

        if (card != null) {
View Full Code Here

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

    }
    return config;
  }

  public void init() throws IdentityProviderException, NumberFormatException, IdentityException, CarbonException {
    IdentityPersistenceManager admin = IdentityPersistenceManager.getPersistanceManager();

    ServerConfiguration serverConf = ServerConfiguration.getInstance();
    String hostName = serverConf.getFirstProperty("HostName");

    if (hostName == null) {
      hostName = "localhost";
    }

    issuer = "http://" + hostName;
   
    String param = null;
   
    param = admin.getParameterValue(IdentityTenantUtil.getRegistry(),IdentityConstants.PARAM_VALID_PERIOD);
   
    if (param == null) {
            addParameters(IdentityTenantUtil.getRegistry());
            validPeriod = Integer.parseInt(admin.getParameterValue(AdminServicesUtil
                    .getSystemRegistry(), IdentityConstants.PARAM_VALID_PERIOD));
        } else {
            validPeriod = Integer.parseInt(param);
        }   
   
    cardName = admin.getParameterValue(IdentityTenantUtil.getRegistry(),
                IdentityConstants.PARAM_CARD_NAME);
    String types = admin.getParameterValue(IdentityTenantUtil.getRegistry(),
                IdentityConstants.PARAM_SUPPORTED_TOKEN_TYPES);
    String[] arrTypes = types.split(",");
    tokenTypeList = new SupportedTokenTypeList();
    for (int i = 0; i < arrTypes.length; i++) {
      tokenTypeList.addSupportedTokenType(arrTypes[i]);
    }

    useSymmetricBinding = "true".equals(admin.getParameter(IdentityTenantUtil.getRegistry(),
        IdentityConstants.PARAM_USE_SYMM_BINDING).getValue());
  }
View Full Code Here

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

    useSymmetricBinding = "true".equals(admin.getParameter(IdentityTenantUtil.getRegistry(),
        IdentityConstants.PARAM_USE_SYMM_BINDING).getValue());
  }
 
  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

        Registry registry = IdentityTenantUtil.getRegistry(null, null);
        addUser(user.getUserName(), user.getPassword(), userClaims, null, realm);

        // OpenId Sign-Up if necessary.
        if (user.getOpenID() != null) {
            IdentityPersistenceManager persistentManager = IdentityPersistenceManager
                    .getPersistanceManager();
            persistentManager.doOpenIdSignUp(registry, realm, user.getOpenID(), user.getUserName());
        }

    }
View Full Code Here

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

                    if (!IdentityConstants.CLAIM_PPID.equals(entry.getKey())) {
                        userClaims.put(entry.getKey(), entry.getValue());
                    }
                }
                user = IdentityUtil.getPPIDDisplayValue(ppid);
                IdentityPersistenceManager manager = IdentityPersistenceManager
                        .getPersistanceManager();
                UserRealm realm = null;
                realm = IdentityTenantUtil.getRealm(null, null);
                Registry registry = null;
                registry = IdentityTenantUtil.getRegistry(null, null);
                addUser(user, uuid, userClaims, null, realm);
                PPIDValueDO ppidValueDO = new PPIDValueDO();
                ppidValueDO.setUserId(user);
                ppidValueDO.setPpid(ppid);
                manager.createPPIDValue(registry, ppidValueDO);
            }
        }

    }
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.