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

Add Azure provider #1

Merged
merged 1 commit into from
Mar 12, 2020
Merged

Add Azure provider #1

merged 1 commit into from
Mar 12, 2020

Conversation

o1oo11oo
Copy link
Contributor

Adds a provider for logging in with Microsoft accounts. This can be either an organization account or a normal Microsoft account, the kind that's allowed needs to be set when creating the app on the Azure portal.

I'm not sure about committing the composer dependencies, I just went along the style of the previous commits that added providers.

The style for the login button was taken from the Microsoft Docs.

@rhukster
Copy link
Member

Thanks, i've not tested but I trust you have :)

@o1oo11oo
Copy link
Contributor Author

Not extensively, we have no logins for the normal website so we only tried logging in to the admin plugin and we didn't try personal Microsoft accounts as Microsoft doesn't recommend enabling that for existing app registrations. But we did try logging in with accounts from our own organization, other organizations and made sure that other organizations don't work if that's not set on the Azure app.

Using the UPN as the email attribute for the user is a little bit wonky, but Microsoft doesn't always include the email claim in the token and oauth2-azure, the library used here, doesn't directly provide a function to get it. It looks like it's possible to get it by also requesting the email scope and then getting the email claim by using $user->claim('email'), but I haven't tried that.

Getting the profile picture should also be possible, but that needs another call to the Graph API.

As mentioned in the description on the plugin config page, it's important to create a client secret on the Azure portal under Certificates & secrets when registering the app, otherwise the oauth flow won't work. Access tokens or ID tokens for the implicit grant don't have to be enabled.

rhukster pushed a commit that referenced this pull request Mar 30, 2022
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.

2 participants