-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix OAuth2.0 based authentication examples problems using cookie #826
base: main
Are you sure you want to change the base?
Conversation
@nokazn I ran into the same issues with authentication (for spotify) and tried out this solution. When setting setting
Changing it up to |
I tried some times, but couldn't reproduce the above error in my environment. |
why is |
Some examples using OAuth 2.0 based authentication with cookie doesn't work correctly in modern browser like Google Chrome and Firefox.
In these examples,
state
value are not set correctly in cookie because the requests for Cloud Functions are sent in cross domain and are not Top Level Navigation.If
SameSite
attribute are not set, browsers treats it asLax
value by default.So I thinkSameSite
attribute should be set toNone
.Edit
The solution in #849 seems to be better, so the example in spotify-auth followed this.
State cookie is sent through the same domain and use
__session
key instead ofstate
.The examples of Instagram and Linkedin are fixed by #849, so I reverted modification for these examples.