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

KeyError 'mail' #32

Closed
yongks opened this issue Nov 26, 2022 · 3 comments
Closed

KeyError 'mail' #32

yongks opened this issue Nov 26, 2022 · 3 comments

Comments

@yongks
Copy link

yongks commented Nov 26, 2022

I'm using Microsoft SSO.

Managed to login and get redirected to /auth/callback, following example code.
However, once redirected, it hits the below issues (trace included below).

File "C:\ProgramData\Anaconda3\lib\site-packages\fastapi_sso\sso\base.py", line 185, in verify_and_process
  return await self.process_login(
File "C:\ProgramData\Anaconda3\lib\site-packages\fastapi_sso\sso\base.py", line 242, in process_login
  return await self.openid_from_response(content)
File "C:\ProgramData\Anaconda3\lib\site-packages\fastapi_sso\sso\microsoft.py", line 45, in openid_from_response
  return OpenID(email=response["mail"], display_name=response["displayName"], provider=cls.provider)
KeyError: 'mail'
@yongks
Copy link
Author

yongks commented Nov 26, 2022

I managed solved my own problem. Turns out it is insufficient permission set in the Azure AD app registration. The solution is to "Grant" the APIs under "API Permission"

@yongks yongks closed this as completed Nov 26, 2022
@dtcMLOps
Copy link

dtcMLOps commented Jan 19, 2023

Hi @yongks can you please share an example of how to use Microsoft SSO?

@dtcMLOps
Copy link

dtcMLOps commented Jan 19, 2023

Hi @yongks can you please share an example of how to use Microsoft SSO?

I have found the examples folder.

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