Uploaded image for project: 'PicketLink'
  1. PicketLink
  2. PLINK-489

Support User Stereotypes in Credential API

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • PLINK_2.6.0.CR5
    • PLINK_2.6.0.CR4
    • IDM
    • None

      Since 2.6.0.CR4 the concept of Stereotypes was introduced.

      This concept can make even easier the configuration of custom Account types, specially regarding credential management.

      Today, if a custom Account type defines a property to store the "user name" with a name other than "loginName", the user must provide a configuration as follows:

      stores.
          jpa()
             .setCredentialHandlerProperty(CredentialHandler.LOGIN_NAME_PROPERTY, "customUserName")
      

      This is required in order to know which property should be used to retrieve users from the underlying store based on their name.

      With the introduction of Stereotypes, Account types can be annotated with @IdentityStereotype(USER) and mark the "user name" property using the @StereotypeProperty as follows:

      @IdentityStereotype(USER)
      public class User extends Agent {
      
          private String customUserName;    
      
          @AttributeProperty
          @StereotypeProperty(IDENTITY_USER_NAME)
          @Unique
          public String getCustomUserName() {
              return this.customUserName;
          }
      }
      

            psilva@redhat.com Pedro Igor Craveiro
            psilva@redhat.com Pedro Igor Craveiro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: