Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In the Identity Server management console, multiple attribute values are separated by comma. If you want to update two email addresses using the user profile UI, you must provide it as follows.

    Code Block
    asela@soasecurity.com,aselapathberiya@soasecurity.com

    See the following screen for how this will look in the user interface of the Identity Server management console.
     

  2. When using the RemoteUserStoreManagerService API, call it as follows.

    Code Block
    setUserClaimValue("username", "http://wso2.org/claims/emailaddress", "asela@soasecurity.org,aselapathberiya@gmail.com", null)

    The GET results are returned in the form of comma separated values for the attribute.

    Code Block
    "asela@soasecurity.org,aselapathberiya@gmail.com"

    The following screen shows how this looks in the LDAP.
     

...

Writing custom attributes

Supposing the attributes of a user are stored in both the user store (LDAP) and another location (JDBC table), the Identity Server needs to retrieve/add the user’s attribute in both these places. In scenarios like this, some customization must be done. To customize this, you can simply extend the current user store manager implementation and write a custom implementation to do it. In the custom user store implementation, you only need to extend the following three methods that help to retrieve/add a user attribute. Other methods can be kept as they are.

  • Method 1.

    Code Block
    public Map<String, String> getUserPropertyValues(String userName, String[] propertyNames, String profileName) throws UserStoreException
  • Method 2.

    Code Block
    protected abstract void doSetUserClaimValue(String userName, String claimURI, String claimValue, String profileName) throws UserStoreException;
  • Method 3.

    Code Block
    protected abstract void doSetUserClaimValues(String userName, Map<String, String> claims, String profileName) throws UserStoreException;

See Writing a Custom User Store Manager for more information on this.