Skip to content

Fix Azure v2 profile method#30

Merged
lepture merged 1 commit intoauthlib:masterfrom
salty-horse:azure_profile
Jul 17, 2019
Merged

Fix Azure v2 profile method#30
lepture merged 1 commit intoauthlib:masterfrom
salty-horse:azure_profile

Conversation

@salty-horse
Copy link
Contributor

This fixes #27.

A few things I'm unsure of:

  1. Passing in your own claims_options will break profile(). Is this OK?
  2. profile() really only accepts token and nonce, but I left the signature as **kwargs because that's its signature elsewhere.
  3. profile() returns a dictionary with the all of the ID token claims. These are more more fields than would be returned by a call to userinfo. Should I return only specific fields?

Tested with:

KEY = ''
PASS = ''
CODE = ''

from loginpass.azure import create_azure_backend
Azure = create_azure_backend('azure', 'common', version=2)
oauth_client = Azure(KEY, PASS, **Azure.OAUTH_CONFIG)
access_token_info = oauth_client.fetch_access_token(code=CODE)
profile = oauth_client.profile(access_token_info)
print(profile)

@lepture lepture merged commit f5f3d8b into authlib:master Jul 17, 2019
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

Successfully merging this pull request may close these issues.

Azure's userinfo endpoint not working in v2

2 participants