Custom User Principle - Websphere

This is a discussion on Custom User Principle - Websphere ; Hi, I have a situation where I would like to extend the default UserPrincipal object to add some additional attributes and capabilities to the UserPrincipal object that are not part of the J2EE Security standard. I have WebSphere global security ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Custom User Principle

  1. Custom User Principle

    Hi,
    I have a situation where I would like to extend the default UserPrincipal object to add some additional attributes and capabilities to the UserPrincipal object that are not part of the J2EE Security standard. I have WebSphere global security turned on and going against a standard LDAP directory,all works just fine without any customization. I still want application developers to get acess to the UserPrinciple, but then be able to cast to an "custom" principal to get further details. Where would I plug into the WebSphere security model to do this? I shouldn't have to link into the Login/Callback process because that works fine. Is there somewhere else I can plug in?

    Thanks!

  2. Re: Custom User Principle

    I have figured out how to change the Subject with a custom LoginModule that adds some custom credential/principal. However, now I'm stuck with how to get this information during a servlet invocation. Since the request.getUserPrincipal() returns a java.security.Principal object, I was expecting to be able to use this somehow get my custom attribute. However, this method returns a com.ibm.ws.security.auth.Identity, which extends the now deprecated java.security.Identity object.

    How can I get access to my custom credential/principal during a servlet invocation?

    Thanks

  3. Re: Custom User Principle

    com.ibm.websphere.security.auth.WSSubject.getCalle rSubject()
    This will return the Subject that is used during the JAAS authentication and will give you access to any credentials or custom principal that you added to that Subject.

+ Reply to Thread