This content has been marked as final. Show 2 replies
no it is not accessible in ksession. one way is to get it from thread context
Try following code to get all principles (user and roles):
Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container"); Set<Principal> principals = subject.getPrincipals();
Thanks! I will try this.