I have configured Google OAuth2 authentication in my Django application, but after selecting an email to log in, I am redirected back to the login page. The browser console shows an error idpiframe_initialization_failed, indicating that my authentication library is deprecated. I have used the new Google Identity Services library with the provided code. How can I ensure that this configuration is correct and avoid the login redirect loop?
I configured Google OAuth2 authentication in my Django application using the new Google Identity Services library. I followed the instructions provided by Google, ensuring my client_id, redirect_uri, and scope are correctly set up. I expected to successfully log in with Google and be redirected to my application's home page after selecting an email.
However, after selecting an email to log in, I am redirected back to the login page, and the browser console shows the error idpiframe_initialization_failed, indicating that my authentication library is deprecated. I have included the necessary scripts and configuration but still encounter this issue.
Here’s my setup:
Added Google Identity Services script:
Configured the client in JavaScript with google.accounts.oauth2.initCodeClient()
Used a button to trigger the OAuth2 flow
I expected the authentication to proceed smoothly, but I'm stuck in a redirect loop. Any suggestions on how to resolve this would be greatly appreciated.