public void setUserClaimValue(String userName, String claimURI, String claimValue, String profileName) throws UserStoreException { getUserStoreManager().setUserClaimValue(userName, claimURI, claimValue, profileName); }
public void addUserClaimValue(String userName, String claimURI, String claimValue, String profileName) throws UserStoreException { String existingClaimValue = getUserStoreManager().getUserClaimValue(userName, claimURI, profileName); if (existingClaimValue == null) { existingClaimValue = EMPTY; } if (claimValue != null && !EMPTY.equals(claimValue) && !EMPTY.equals(existingClaimValue)) { claimValue = existingClaimValue + "," + claimValue; } getUserStoreManager().setUserClaimValue(userName, claimURI, claimValue, profileName); }
@Override public boolean doPostUpdateCredentialByAdmin(String userName, Object credential, UserStoreManager userStoreManager) throws UserStoreException { try { if (!isEnable() || !userStoreManager.isSCIMEnabled()) { return true; } } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new UserStoreException("Error while reading isScimEnabled from userstore manager", e); } //update last-modified-date try { Date date = new Date(); String lastModifiedDate = AttributeUtil.formatDateTime(date); userStoreManager.setUserClaimValue( userName, SCIMConstants.META_LAST_MODIFIED_URI, lastModifiedDate, null); } catch (org.wso2.carbon.user.api.UserStoreException e) { if (e.getMessage().contains("UserNotFound")) { if (log.isDebugEnabled()) { log.debug("User " + userName + " doesn't exist"); } } else { throw new UserStoreException("Error updating SCIM metadata in doPostUpdateCredentialByAdmin " + "listener", e); } } return true; }
@Override public boolean doPostUpdateCredentialByAdmin(String userName, Object credential, UserStoreManager userStoreManager) throws UserStoreException { try { if (!isEnable() || userStoreManager == null || !userStoreManager.isSCIMEnabled()) { return true; } } catch (org.wso2.carbon.user.api.UserStoreException e) { throw new UserStoreException("Error while reading isScimEnabled from userstore manager", e); } // Update last-modified-date. try { Date date = new Date(); String lastModifiedDate = AttributeUtil.formatDateTime(date); userStoreManager.setUserClaimValue( userName, SCIMConstants.CommonSchemaConstants.LAST_MODIFIED_URI, lastModifiedDate, null); } catch (org.wso2.carbon.user.api.UserStoreException e) { if (e.getMessage().contains("UserNotFound")) { if (log.isDebugEnabled()) { log.debug("User " + userName + " doesn't exist"); } } else { throw new UserStoreException("Error updating SCIM metadata in doPostUpdateCredentialByAdmin " + "listener", e); } } return true; }
claimValue = claim.getValue(); getUserStoreManager().setUserClaimValue(userName, claim.getClaimURI(), claimValue, profileName);