comic / grand-challenge.org

A platform for end-to-end development of machine learning solutions in biomedical imaging
https://grand-challenge.org
Apache License 2.0
168 stars 50 forks source link

Google logins broken with django-allauth 0.62+ #3329

Closed pkcakeout closed 2 months ago

pkcakeout commented 2 months ago

Recipe

image

image

Result

image

Unexpected Error

No login possible.

@amickan reported that no sentry errors are being recorded. I cannot login, presumably many other people cannot login either.

jmsmkn commented 2 months ago

I suspect this is related to the upgrade of allauth, so pinned it as a speculative fix.

jmsmkn commented 2 months ago

The exception appears to be:

24 April 2024 at 15:56 (UTC+2:00)   File "/opt/poetry/.venv/lib/python3.11/site-packages/django/urls/resolvers.py", line 828, in _reverse_with_prefix   web
24 April 2024 at 15:56 (UTC+2:00)   raise NoReverseMatch(msg)   web
24 April 2024 at 15:56 (UTC+2:00)   django.urls.exceptions.NoReverseMatch: Reverse for 'google_callback' not found. 'google_callback' is not a valid view function or pattern name.
jmsmkn commented 2 months ago

In allauth the social account dependencies were separated out in 0.62.0 (https://github.com/pennersr/django-allauth/commit/8172ea9fba7d899323ab53069afb80c31fa9f3c3) but the backwards incompatibility notice was later moved to 0.60.1 (https://github.com/pennersr/django-allauth/commit/80088ce319b03a9df79f8a9d0cf49dad7ef50dc4). So, we upgraded thinking that we didn't have to do anything.

jmsmkn commented 2 months ago

The upgrade still has the problem of reversing for "google_callback". This works if we use the top level provider. For some reason we have our own Gmail provider which was added in #1713 and modified in #1715. Not sure why, we only modify the uid.

jmsmkn commented 2 months ago

"gmail_callback" can be found, I will need to do some more digging tomorrow.

pkcakeout commented 2 months ago

Cool... thanks for digging this up... probably not the easiest to debug given that we have no sentry and it requires google<->client communication via domain names...

jmsmkn commented 2 months ago

Following instructions:

To create developer credentials. Downside is that Google does not allow using gc.localhost as the authorised domain, so have to get this working on 127.0.0.1.

jmsmkn commented 2 months ago

Okay, found the problem, it was due to a refactoring in allauth.