/** * Get claims of this user. * * @return List of User claims. * @throws IdentityStoreException Identity store exception. */ public List<Claim> getClaims() throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(this.uniqueUserId); }
@Override public List<Claim> getClaimsOfUser(String uniqueUserId, List<MetaClaim> metaClaims) throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(uniqueUserId, metaClaims); }
/** * Get claims of this user for given URIs. * * @param metaClaims Claim URIs that needs to be retrieved. * @return List of User claims. * @throws IdentityStoreException Identity store exception. */ public List<Claim> getClaims(List<MetaClaim> metaClaims) throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(uniqueUserId, metaClaims); }
@Override public List<Claim> execute() throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(uniqueUserId); } }).pushEvent(IdentityStoreInterceptorConstants.POST_GET_CLAIMS_OF_USER_BY_ID, (eventProperties) -> {
@Override public List<Claim> execute() throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(uniqueUserId, metaClaims); } }).pushEvent(IdentityStoreInterceptorConstants.POST_GET_CLAIMS_OF_USER_BY_ID_META_CLAIMS, (eventProperties) -> {
@Override public List<Claim> getClaimsOfUser(String uniqueUserId) throws IdentityStoreException, UserNotFoundException { return identityStore.getClaimsOfUser(uniqueUserId); }
@Override public List<Claim> getClaimsOfUser(String uniqueUserId, List<MetaClaim> metaClaims) throws UserPortalUIException { List<Claim> claimList = null; if (StringUtils.isNullOrEmpty(uniqueUserId)) { throw new UserPortalUIException("Invalid unique user id."); } if (metaClaims != null && !metaClaims.isEmpty()) { try { claimList = getRealmService().getIdentityStore().getClaimsOfUser(uniqueUserId, metaClaims); } catch (IdentityStoreException | UserNotFoundException e) { String error = "Failed to get claims of the user."; LOGGER.error(error, e); throw new UserPortalUIException(error); } } else { claimList = Collections.emptyList(); } return claimList; }
claims = getRealmService().getIdentityStore().getClaimsOfUser(uniqueUserId, metaClaims); } catch (IdentityStoreException e) { LOGGER.error(String.format("Failed to get the user claims for user - %s", uniqueUserId), e);
List<Claim> claimsList = identityStore.getClaimsOfUser(user.getUniqueUserId());
/** * Get user claim value from identity store manager * * @param uniqueUserID * @param claimuri * @return * @throws IdentityStoreException * @throws UserNotFoundException */ public static String getClaimFromIdentityStore(String uniqueUserID, String claimuri) throws IdentityStoreException, UserNotFoundException { RealmService realmService = IdentityRecoveryServiceDataHolder.getInstance().getRealmService(); IdentityStore identityStore = realmService.getIdentityStore(); String claimValue = ""; if (identityStore != null) { List<Claim> claimsList = identityStore.getClaimsOfUser(uniqueUserID); if (claimsList != null && !claimsList.isEmpty()) { for (Claim claim : claimsList) { if (claim.getClaimUri().equals(claimuri)) { claimValue = claim.getValue(); break; } } } } return claimValue; }