use of org.wso2.carbon.identity.core.IdentityClaimManager in project carbon-identity-framework by wso2.
the class UserRegistrationService method readUserFieldsForUserRegistration.
public UserFieldDTO[] readUserFieldsForUserRegistration(String dialect) throws IdentityException {
IdentityClaimManager claimManager = null;
Claim[] claims = null;
List<UserFieldDTO> claimList = null;
UserRealm realm = null;
claimManager = IdentityClaimManager.getInstance();
realm = IdentityTenantUtil.getRealm(null, null);
claims = claimManager.getAllSupportedClaims(dialect, realm);
if (claims == null || claims.length == 0) {
return new UserFieldDTO[0];
}
claimList = new ArrayList<UserFieldDTO>();
for (Claim claim : claims) {
if (claim.getDisplayTag() != null && !IdentityConstants.PPID_DISPLAY_VALUE.equals(claim.getDisplayTag())) {
if (UserCoreConstants.ClaimTypeURIs.ACCOUNT_STATUS.equals(claim.getClaimUri())) {
continue;
}
if (!claim.isReadOnly()) {
claimList.add(getUserFieldDTO(claim.getClaimUri(), claim.getDisplayTag(), claim.isRequired(), claim.getDisplayOrder(), claim.getRegEx(), claim.isSupportedByDefault()));
}
}
}
return claimList.toArray(new UserFieldDTO[claimList.size()]);
}
use of org.wso2.carbon.identity.core.IdentityClaimManager in project identity-governance by wso2-extensions.
the class NotificationUsernameRecoveryManager method getUserIdentitySupportedClaims.
/**
* This returns the user supported claims.
*
* @param dialect
* @return
* @throws IdentityRecoveryException
*/
public String[] getUserIdentitySupportedClaims(String dialect, String tenantDomain) throws IdentityException {
IdentityClaimManager claimManager;
Claim[] claims;
claimManager = IdentityClaimManager.getInstance();
UserRealm realm = IdentityTenantUtil.getRealm(null, null);
claims = claimManager.getAllSupportedClaims(dialect, realm);
if (claims == null || claims.length == 0) {
log.warn("Could not find any matching claims for requested dialect : " + dialect);
return new String[0];
}
List<String> claimList = new ArrayList<>();
for (int i = 0; i < claims.length; i++) {
if (claims[i].getDisplayTag() != null && !IdentityConstants.PPID_DISPLAY_VALUE.equals(claims[i].getDisplayTag())) {
if (UserCoreConstants.ClaimTypeURIs.ACCOUNT_STATUS.equals(claims[i].getClaimUri())) {
continue;
}
if (claims[i].isSupportedByDefault() && (!claims[i].isReadOnly())) {
claimList.add(claims[i].getClaimUri());
}
}
}
return claimList.toArray(new String[claimList.size()]);
}
use of org.wso2.carbon.identity.core.IdentityClaimManager in project identity-governance by wso2-extensions.
the class NotificationUsernameRecoveryManager method getIdentitySupportedClaims.
/**
* This returns the user supported claims info.
*
* @param dialect
* @return
* @throws IdentityRecoveryException
*/
public Claim[] getIdentitySupportedClaims(String dialect, String tenantDomain) throws IdentityException {
IdentityClaimManager claimManager;
Claim[] claims;
claimManager = IdentityClaimManager.getInstance();
UserRealm realm = IdentityTenantUtil.getRealm(tenantDomain, null);
claims = claimManager.getAllSupportedClaims(dialect, realm);
if (claims == null || claims.length == 0) {
log.warn("Could not find any matching claims for requested dialect : " + dialect);
return new Claim[0];
}
return claims;
}
use of org.wso2.carbon.identity.core.IdentityClaimManager in project carbon-identity-framework by wso2.
the class UserInformationRecoveryService method getUserIdentitySupportedClaims.
/**
* This returns the user supported claims.
*
* @param dialect
* @return
* @throws IdentityException
*/
public UserIdentityClaimDTO[] getUserIdentitySupportedClaims(String dialect) throws IdentityException {
IdentityClaimManager claimManager = null;
Claim[] claims = null;
UserRealm realm = null;
claimManager = IdentityClaimManager.getInstance();
realm = IdentityTenantUtil.getRealm(null, null);
claims = claimManager.getAllSupportedClaims(dialect, realm);
if (claims == null || claims.length == 0) {
log.warn("Could not find any matching claims for requested dialect : " + dialect);
return new UserIdentityClaimDTO[0];
}
List<UserIdentityClaimDTO> claimList = new ArrayList<UserIdentityClaimDTO>();
for (int i = 0; i < claims.length; i++) {
if (claims[i].getDisplayTag() != null && !IdentityConstants.PPID_DISPLAY_VALUE.equals(claims[i].getDisplayTag())) {
if (UserCoreConstants.ClaimTypeURIs.ACCOUNT_STATUS.equals(claims[i].getClaimUri())) {
continue;
}
if (claims[i].isSupportedByDefault() && (!claims[i].isReadOnly())) {
UserIdentityClaimDTO claimDto = new UserIdentityClaimDTO();
claimDto.setClaimUri(claims[i].getClaimUri());
claimDto.setClaimValue(claims[i].getValue());
claimDto.setRequired(claims[i].isRequired());
claimDto.setDisplayName(claims[i].getDisplayTag());
claimList.add(claimDto);
}
}
}
return claimList.toArray(new UserIdentityClaimDTO[claimList.size()]);
}
Aggregations