Official way to authorize AWS lambda with OpenID Connect credentials

241 Views Asked by At

I have a working authentication flow, using federatedSignIn with Google as the provider. Now I have to set up OpenID Connect as an alternative provider (with Google as the audience). The sign in flow works well, but the subsequent authorization to use my lambda (set up using API Gateway) fails, because for some reason I cannot get the ID Token anymore.

In other words, with Google as the provider, I use Auth.currentSession() to get the ID Token that I then set into the Authorization header, but with OIDC, Auth.currentSession() is undefined. The Auth.federatedSignIn does return several keys and ids, namely accessKeyId, identityId, secretAccessKey, and sessionToken, but none of these are accepted as an alternative to the ID Token. Could you explain what I am missing?

0

There are 0 best solutions below