Examples of OpenIDClaimDTO


Examples of org.wso2.carbon.identity.provider.dto.OpenIDClaimDTO

     */
    protected void setSimpleAttributeRegistrationValues(SRegResponse response,
            Map<String, OpenIDClaimDTO> claimValues) throws MessageException {

        Iterator<Entry<String, OpenIDClaimDTO>> iterator = null;
        OpenIDClaimDTO claim = null;
        Entry<String, OpenIDClaimDTO> entry = null;

        iterator = claimValues.entrySet().iterator();

        while (iterator.hasNext()) {
            entry = iterator.next();
            claim = entry.getValue();
            response.addAttribute(claim.getClaimUri(), claim.getClaimValue());
        }
    }
View Full Code Here

Examples of org.wso2.carbon.identity.provider.dto.OpenIDClaimDTO

  protected void setAttributeExchangeValues(FetchResponse response,
      Map<String, OpenIDClaimDTO> claimValues) throws MessageException {

    Iterator<Entry<String, OpenIDClaimDTO>> iterator = null;
    Entry<String, OpenIDClaimDTO> entry = null;
    OpenIDClaimDTO claim = null;

    iterator = claimValues.entrySet().iterator();

    while (iterator.hasNext()) {
      entry = iterator.next();
      claim = (OpenIDClaimDTO) entry.getValue();
      response.addAttribute(claim.getClaimUri(),claim.getClaimValue());
    }
  }
View Full Code Here

Examples of org.wso2.carbon.identity.provider.dto.OpenIDClaimDTO

    private OpenIDClaimDTO[] getClaimValues(String openId, String profileId,
            List<String> requiredClaims) throws Exception {
        UserStoreManager userStore = null;
        Map<String, String> claimValues = null;
        OpenIDClaimDTO[] claims = null;
        OpenIDClaimDTO dto = null;
        IdentityClaimManager claimManager = null;
        Claim[] claimData = null;
        String[] claimArray = new String[requiredClaims.size()];
        String userName = null;
        String domainName = null;
        String tenatUser = null;

        userName = OpenIDUtil.getUserName(openId);
        domainName = TenantUtils.getDomainNameFromOpenId(openId);

        tenatUser = userName;

        if (userName.contains("@")) {
            tenatUser = userName.substring(0, userName.indexOf("@"));
        }

        userStore = IdentityTenantUtil.getRealm(domainName, userName).getUserStoreManager();

        claimValues = userStore.getUserClaimValues(tenatUser, requiredClaims.toArray(claimArray),
                profileId);

        claims = new OpenIDClaimDTO[claimValues.size()];
        int i = 0;
        claimManager = IdentityClaimManager.getInstance();
        claimData = claimManager.getAllSupportedClaims(IdentityConstants.OPENID_SREG_DIALECT,
                IdentityTenantUtil.getRealm(domainName, userName));

        for (int j = 0; j < claimData.length; j++) {
            if (claimValues.containsKey(claimData[j].getClaimUri())) {
                dto = new OpenIDClaimDTO();
                dto.setClaimUri(claimData[j].getClaimUri());
                dto.setClaimValue(claimValues.get(claimData[j].getClaimUri()));
                dto.setDisplayTag(claimData[j].getDisplayTag());
                dto.setDescription(claimData[j].getDescription());
                claims[i++] = dto;
            }
        }

        return claims;
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.