I used JAAS and I don't know how to get the information about the user id, username .. should I set the values using a ManagedBean, or the JAAS it self provides it.
JAAS get User information
1.5k Views Asked by Houssin Inani At
2
There are 2 best solutions below
0
On
Well to get user information you have to use principals
refer https://nick-lab.gs.washington.edu/java/jdk1.4.1/guide/security/jaas/tutorials/GeneralAcnOnly.html#SampleLMPrincipal
you will also get a sample code there
after setting a principal to your subject in your loginmodule you can get the name with the command
loginContext.getSubject().getPrincipals().iterator().next().getName()
associate principal to each information and add it to subject while logging in then you can get the user data with the subject.. if anymore doubts comment
The JAAS provide username and does not provide all information, here a suggestion to recover all infromation with ManagedBean and JSP
With JSF you can get all informations about the user like this :
With JSP you can get all informations about the user like this :