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

OpenID Connect with PKCE Enabled - Not syncing user information #3499

Open
jonnyhoff opened this issue Oct 26, 2023 · 1 comment
Open

OpenID Connect with PKCE Enabled - Not syncing user information #3499

jonnyhoff opened this issue Oct 26, 2023 · 1 comment

Comments

@jonnyhoff
Copy link

I've setup OpenID Connect with PKCE enabled that authenticates on Windows Server Active Directory as you can see below. Users are able to log in but they get generic usernames, ie. user , user0, etc. and no group information.

Current Config:

SOCIALACCOUNT_PROVIDERS = {
    'openid_connect': {
        'APP': {
            "provider_id": "oauth2",
            "name": "AD Oauth2",
            'client_id': config("OAUTH_CLIENT_ID"),
            'secret': '',
            "settings": {
                "server_url": "https://" + config("OAUTH_SERVER") + '/Adfs',
            },
        },
        'OAUTH_PKCE_ENABLED': True,
        'SCOPE': ['openid', 'email', 'profile'],
    }
}

Social Account Record:
image


User Record:
image

Generic usernames are created, ie. user , user0, etc. and no group information.

@jonnyhoff jonnyhoff changed the title OpenID Connect with PKCE Enable - Not syncing user information OpenID Connect with PKCE Enabled - Not syncing user information Oct 27, 2023
@pennersr
Copy link
Owner

pennersr commented May 3, 2024

The Microsoft provider uses this for username:

https://github.com/pennersr/django-allauth/blob/main/allauth/socialaccount/providers/microsoft/provider.py#L42

If that is not there, it will fallback to generic usernames. Is that (mailNickname) in your extra data?

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

2 participants