0

I am working on a NodeJS application that uses Passport for authentication and is deployed on IBM Cloud AppID SAML. While I am able to successfully authenticate a user using the AppID authentication mechanism, I am unable to retrieve the idToken, refreshToken, and accessToken that are supposed to be returned in the callback function.

Does anyone have experience with using AppID SAML with Passport and know what could be causing this issue, or if you have a link for documentation exactly about that ?

Any help or suggestions would be greatly appreciated. Thank you.

i tried that for login to application :

app.get('/api/iam/logonsso',
         passport.authenticate(WebAppStrategy.STRATEGY_NAME, {
             successRedirect: '/',
             forceLogin: true
         })
)

And this function for callback :

app.get('/api/iam/callback', passport.authenticate(WebAppStrategy.STRATEGY_NAME));
takichy
  • 3
  • 1

1 Answers1

0

the access and identity token will be stored in the request session after a successful authentication. You can access them from every protected resource by invoking:

req.session[WebAppStrategy.AUTH_CONTEXT].accessToken // raw JWT access token
req.session[WebAppStrategy.AUTH_CONTEXT].accessTokenPayload // decoded access token


req.session[WebAppStrategy.AUTH_CONTEXT].identityToken // raw JWT identity token
req.session[WebAppStrategy.AUTH_CONTEXT].identityTokenPayload // decoded identity token
  • my req.session is object just with cookie object and user i can't find other information so i don't know why, knowing that the sso authentication went well – takichy Mar 20 '23 at 16:25