Search code examples
tokensamlopenam

Get authentication token.id from OpenAm within Saml response


I have implemented SSO with paspport-saml and OpenAM. I can get certain user attributes such as id,givenName etc. But now I want to get authentication token id with Saml response for further authentication of web services.

How I can get authentication token id with Saml response?


Solution

  • You can get SAML assertion Id from saml response or you can use nameID based on ID provider setting it will contain either userName or principle object.

    String ID = credential.getAuthenticationAssertion().getID();
    
    or 
    
    String userName = credential.getNameID().getValue();