-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
feat: add support for azure ad oauth #745
Conversation
I'm so sorry for missing it. Will review it now |
|
||
async def fetch_user_info(self, access_token) -> _OauthUserInfo: | ||
headers = {'Authorization': f'Bearer {access_token}'} | ||
user_response = await self.http_client.fetch('https://graph.microsoft.com/v1.0/me', headers=headers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you try using the same approach as in GitlabOAuthAuthenticator? I.e. extend OAuth2Mixin
and then make a request by
user = await self.oauth2_request(
'https://graph.microsoft.com/v1.0/me',
access_token=access_token)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I will try this next week!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I wasn't able to get it to work with OAuth2Mixin. I would get unauthorized error 401. It might be that the Microsoft endpoint doesn't support the fetch methods of either embedding access token in URL or access token as POST request body (used by oauth2_request).
https://learn.microsoft.com/en-us/graph/auth-v2-user?tabs=http#request
^ Their example in this link only shows using the header method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for trying!
Authentication.md wiki snippet:
|
@bugy is there a dev release of this anywhere that can be downloaded? |
The dev release has a date of December 2023. Am I misreading it? |
@tvalenta oh, the build was not running for a long time already :( |
I'd like to give this build a try -- any chance cicd would now build the dev release? |
@tvalenta the build should be ready now :) sorry for delay |
With regards to #741
Adds support for Azure AD OAuth