For one of my use case I need to send the ID token from Google for HTTP call.
I looked at the different options, but only the access token seems to be made available.
How can I retrieve the ID token to send it as header for HTTP call ?
Thanks for posting here and welcome to the community!
I am not sure I understand your question correctly - but you can use the Generic Credential Type and set a customer Header Auth where you can specify the ID as a header to be sent in your HTTP request node.
What exactly is your intention with the ID token? You should be able to get it through a HTTP request node using your Google OAuth2 Access Token credentials. Have you tried that already?
Here’s more information on how access tokens are used within the Google OAuth2 that we implemented in n8n:
I think one way you can achieve to get the token IDs is by using the Google Identity API. You can make a call to /oauth2/v1/userinfo or /auth/userinfo.profile - have a look at their docs:
The reason why we don’t use ID tokens as part of our credentials is that we have a strict policy of not exposing any credentials data to end users .
is there any particular API requires you to use an ID token for auth?
my understanding is that id_token is a often signed string containing some identity related data, but isn’t meant to be send as an auth header on any request.
That’s an understandable use case. However n8n has a strict policy to not expose decrypted credentials to users, and the current oauth setup can only use access_token for auth headers.
I’m not sure how to make n8n work for this use-case, but I’ll think more about it, and If i come up with something, I’ll let you know.