jaasfilenet-p8filenet-content-engineltpacontent-platform-engine

To get the Username and Password from LTPA token for Filenet-P8 CE Connection


We have a Custom developed application and I want to make a Connection with Filenet-P8 using Java API's but the problem is I want to fetch the Username and pswd from LTPA token. I do not have prior exp. with LTPA so I don't know how to achieve this?

A quick Google Search gave me the below link - but I do not have some of the info which is used in this link --> How to use the information in an LTPA token

It's been 1 week now and I am struggling to achieve the desired result. Please assist.


Solution

  • LTPA token does not contain password in any form. If you expected to connect to Content Engine using username/password authentication and use LTPA token as the source of the credentials, then this is not possible.

    As you already have LTPA token, I assume you are operating in the environment where JAAS context has been established and you were able to authenticate to WAS where Content Engine is running (hence LTPA token was granted). If this is the case, you can simply use authenticated JAAS subject with CE com.filenet.api.util.UserContext:

    // Obtain the authenticated JAAS subject
    // For the code operating within WAS the below will work for already authenticated calls
    Subject subject = com.ibm.websphere.security.auth.WSSubject.getCallerSubject();
    
    UserContext.doAs(subject, new PrivilegedExceptionAction<Object>() {
        @Override
        public Object run() throws Exception {
            // CE operations here 
        }
    });