[Google Login] Got 403 because of unexpected scope parameter #10934
Unanswered
mazipan-wartek
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an app using Google Login using Next-Auth.
And still using Pages Router.
The setup is pretty default, something like this:
It is working well on the local, but got 403 after deployed.
After digging some part, I realize that it because it redirect to URL with a wrong scope parameter in it.
Something like this:
/api/auth/callback/google?state={STATE}&code={CODE}&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=0&prompt=consent
The scope contains:
email
profile
openid
https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile
https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
It only shows text
403 Forbidden
in the Page.And if I manually delete the
https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile
andhttps%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
from the parameter, it goes well and user be able to login perfectly.Anyone here be able to help me point out what's missing here 🙏 ?
Beta Was this translation helpful? Give feedback.
All reactions