Josh Smith created SHIRO-367:
--------------------------------
Summary: Support for auto population of custom principal records
Key: SHIRO-367
URL: https://issues.apache.org/jira/browse/SHIRO-367
Project: Shiro
Issue Type: New Feature
Components: Subject
Affects Versions: 1.2.0
Environment: All
Reporter: Josh Smith
By default, adding any custom principal objects to the subject is overly
difficult, and the implementation of it either reduces the benefit of having
Shiro handle authentication, or required duplicate calls to the data store for
authentication credentials.
By default, I think Realms should be extended so that any additional
information about the user that is returned from the autentication query
(JdbcRealm, Active Directory, etc...) that is not part of the credentials
matching process, should be auto-appended to the subject principals collection.
This would allow developers to add items to the principals for a user simply by
controlling what data points came back from the data store call.
In the case of a JdbcRealm, this would be as simple as adding fields to the
return type on the authenticationQuery. They could be mapped to the principal
using Strings if we needed simplicity (but more accurate type mappings would be
nice), making them immediately accessible without having to implement the
custom logic to extend or override doGetAuthenticationInfo. Simply map them as
a key value pair using the column name from the query as the key, and then the
value.
Same could be done for all other default realms (ActiveDirectory would be a big
one).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira