...
This would cause the value of "role" from the sql query to govern the choice of template. This is a snippet from our actual configuration.
Behind the scenes
The IUserIdentityStore interface is the mechanism for retrieving the unique identifier for the current user in the portal. There is one implementation of this interfact: RDBMUserIdentityStore
. Two properties as well as the value of person attributes for the user affect how this class makes the choice of template.
- When the property
Code Block org.jasig.portal.services.Authentication.autoCreateUsers=true
RDBMUserIdentityStore
will automatically create all necessary data for a new portal user based on a template user. If set to false users data will not be automatically created. So far there is no other mechanism for creating user data so this property is always set to true.
- The template user is specified either by the property
defaultTemplateUserName
by mapping a directory attribute to uPortalTemplateUserName. When a user logs in for the first time,RDBMUserIdentityStore
first looks for a person attribute nameduPortalTemplateUserName
. The value of that attribute is expected to be the username of an existing user. The existing user is then the template for the new user. If no attribute is of that name is mapped the template user name comes from the propertyorg.jasig.portal.services.Authentication.defaultTemplateUserName
. In the distribution this is set to the userdemo
:
This means that if you make no changes and map no attribute to uPortalTemplateUserName then all new users will be cloned from the userCode Block org.jasig.portal.services.Authentication.defaultTemplateUserName=demo
demo
.