Skip to content
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

[Question] Email address marked as unverified with Github auth #2150

Closed
gideonthomas opened this issue Nov 14, 2018 · 5 comments
Closed

[Question] Email address marked as unverified with Github auth #2150

gideonthomas opened this issue Nov 14, 2018 · 5 comments

Comments

@gideonthomas
Copy link

tldr; can allauth automatically mark a user's email address as verified after successfully authenticating using Github for the first time?

I noticed that the Github allauth provider does not mark email addresses as verified when creating the EmailAddress instance on logging in. Github does not seem to send any data in the OAuth callback indicating that the email has been verified or not. However, according to this documentation on Github, Github accounts with unverified emails are not allowed to authorize OAuth apps.

Based on this documentation, can allauth automatically mark a user's email as verified once the user successfully logs in via Github for the first time (without the email verification step since Github already does this)?

@Pomax
Copy link

Pomax commented Nov 21, 2018

Looking at https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/providers/google/provider.py there is a way to make this happen, but loads of providers don't come with a provider-specific setting that lets us say "we know these emails are verified by the very fact that the user was able to grant permissions". For instance, https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/providers/github/provider.py doesn't have any way to say "emails are verified, even if the oauth process doesn't report on that".

@pennersr
Copy link
Owner

You can use `SOCIALACCOUNT_PROVIDER = { "github": { "VERIFIED_EMAIL": True } } to force marking them as verified.

@Pomax
Copy link

Pomax commented Oct 11, 2020

@pennersr is that information in the docs somewhere? If not, can that be added before closing the issue? (information in closed issues basically becomes lost due to how github implements search, so even if it helped us this one time, future folks would still be just as lost as we were)

@pennersr
Copy link
Owner

@Pomax ... it now is: e04fbe9

@Pomax
Copy link

Pomax commented Oct 14, 2020

fantastic, thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants