I am using OAuth 2.0 for google SingIn, it is opening a popup window for user authentication but i want to open in same tab itself, please help me. Thanks in advance.
The popup window opens if you use Google Sign-In JavaScript library. You have to use server side api client libraries to authenticate / authorize without a popup. https://developers.google.com/identity/protocols/OAuth2WebServer
You can use ux_mode: redirect
to change Google to Redirect mode which will open in the same tab instead of in a popup
.
Ref: https://developers.google.com/identity/sign-in/web/reference#gapiauth2clientconfig
Then on your redirect landing page, use auth2.currentUser.get()
to retrieve the signed in Google User object.
(I know this is an old question, but this was one of the first results in a web search; thought it might help others who end up here as well)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With