api.idToken empty object in Post Login Action

Hi,
I’m trying to get the user token in the Post Login Action to pass it to my server via a sendRedirectTo.

Apparently it is available in api.tokenId, but this is an empty object “{}”.

Is there something I can call to get it? I’ve tried the /userinfo call via axios as I’m not sure how to directly call it on the API. I’m passing my accessToken (which works on other calls to the /api/v2/…) but I’m getting a 401 Unauthorized error.

Any help would be appreciated.
Cheers,
Stephen

Hi @stephen.graham

Unfortunately, the idToken cannot be retrieved within an action. You can read on how an idToken is retrieved here.

Otherwise, I would advise to return the idToken of an user via the Get Token flow through the Resource Owner Password Flow of our Authentication API.

This will help you retrieve the Access Token, IdToken and Refresh Token of the specific user sessions.

If you have any other questions, feel free to let me know by leaving a reply!

Kind Regards,
Nik

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.