-
Enhancement
-
Resolution: Done
-
Major
-
PLINK_2.6.0.CR4
-
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; } }