Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't the google JWT token be decoded by jwt.io

I have Google authentication enabled in an Azure App Service .NET Core application, and I am trying to generate an access token using Postman: enter image description here

An access token and an id_token get successfully generated, but when I input the access token into jwt.io, I see gibberish back: enter image description here

I am new to google auth as well as JWT in general, so my expectation may be totally invalid, but shouldn't I be able to decode the token on jwt.io?

like image 493
Mikeyg36 Avatar asked Feb 05 '18 13:02

Mikeyg36


1 Answers

The access token is not a JWT. The id_token is a JWT and you should be able to decode it using jwt.io.

The difference is connected to the difference between OAuth 2.0 and OpenID Connect.

The access token is used to make additional requests to Google API: https://developers.google.com/identity/protocols/OAuth2WebServer#callinganapi

The id_token already holds the information for the authenticating user: https://developers.google.com/identity/protocols/OpenIDConnect#obtainuserinfo

like image 93
Boaz Avatar answered Sep 27 '22 16:09

Boaz