Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

azure - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...