How can I use Django Allauth and Google Identity Services (GSI) simultaneously for Google login?

I have a Django project where I want to support Google login in two ways:

  • Classic OAuth redirect flow using Django Allauth.
  • Google One Tap / GSI login.

I tried using the same Google OAuth client ID for both flows.

The GSI One Tap login works. The Allauth button login now fails with:

Access blocked: This app’s request is invalid
Error 400: redirect_uri_mismatc

I tried:

- Using data-login_uri pointing to {% url 'google_login_by_token' %} for GSI.
- Keeping {% provider_login_url 'google' %} for Allauth.

I want to keep both login methods on the same site:

  • GSI One Tap (token-based)
  • Allauth OAuth redirect (classic button)

Thank you for any suggestions

Вернуться на верх