Replies: 29 comments
|
Are you referring to Microsoft Entra ID (formerly Azure AD)? |
|
Yes :) |
|
I’ve never used that provider, so I need a little help. Can you tell me which one of these might be the right one for you (if any)? The Microsoft-Azure provider has an extra configuration called AZURE_TENANT_ID. https://socialiteproviders.com/Microsoft/ |
|
https://socialiteproviders.com/Microsoft-Azure/ This one has exactly the options that I have already configured on other services, including TENANT_ID Azure AD to Entra ID has been a recent branding change, but everything else is identical, and most open source projects still retain the old naming. If it is of any help, I have succesfully used Bookstack with Entra, and it also uses socialite: https://github.com/BookStackApp/BookStack I'd be happy to test things out for you if you can provide a test container |
|
Ok cool! I might be able to include it today but I'll let you know when it's done. |
|
I think it will work just fine, but could you please test it before I release it? I have pushed a environment:
- AZURE_CLIENT_ID=CLIENT_ID # change id
- AZURE_CLIENT_SECRET=CLIENT_SECRET # change secret
- AZURE_TENANT_ID=TENANT_ID # change id
- AZURE_PROXY=http://your-proxy-url # change url (optional configuration) |
|
Works great! Thank you! |
|
Would it be possible to add the email claim? |
|
I don't see any reference to |
|
In short, claims are the values ratified in the OIDC/OAuth 2.0 standard used to pass information in the jwt token. A longer answer can be found here (it's a Microsoft resource but Oauth 2.0 is an open standard and it works about the same with most identity providers): |
|
Did Many Notes create an account for you when you first logged in through SSO? Did it use the email from your SSO provider? Where would you like Many Notes to use that other optional email? |
|
Yes it did, it worked perfectly fine! I used a clean database for testing, so zero users, the first user who logged in with oidc was created as super admin, and the rest as normal editors. For the username it used the user's name field, and as email it used the preferred_username (which in the Microsoft realm is the upn I.e. username@domain.com). But the email does not necessarily correspond to the upn. And if I may have an additional suggestion, it would be great to have an option to directly login with OIDC without having to click on the login button. Thank you again so much, you're awesome! |
After you login, the driver only returns that email as you can see here. So, the responsibility of checking for a possible email claim belongs to the driver. What you're saying makes sense, but since I have no experience with that SSO provider, I have no idea if this would make sense in all cases. So, I'm not sure if they would accept this change because it would affect everyone. Does the email claim get validated to ensure that the email address is yours?
You can disable local authentication. Read this. |
|
OOh, I am so sorry, after searching for a bit, I realise now that the Microsoft Azure provider from Socialite is actually the older one that does not support additional claims. Sorry my information was wrong, the most up to date one was this: https://github.com/SocialiteProviders/Microsoft return Socialite::driver('microsoft') (though i am not sure it is necessary to specify them) Yes the email is validated within the IdP. For local authentication, I did set SETTINGS_LOCAL_AUTH_ENABLED=false and added a logout URL with AZURE_POST_LOGOUT_REDIRECT_URI=https://login.microsoftonline.com/domain.onmicrosoft.com/oauth2/v2.0/logout but the starting page still shows the login form. |
|
Is it too much work to set up a working test provider? Otherwise, I can only try if you continue testing.
I forgot to add AZURE_POST_LOGOUT_REDIRECT_URI. It will be fixed in the next release. |
|
How do you mean set up a working test provider? I'm happy to test |
I meant to configure the Microsoft provider with those cases to debug what data is coming from the provider. The AZURE_POST_LOGOUT_REDIRECT_URI should be working now. I pushed another version to the dev tag so update the image. Add the following environment variable to see the debug information: environment:
- APP_DEBUG=trueLogin with a user having email claim and when Microsoft redirects you back to Many Notes, you will see the email and the full data coming from the provider using different settings. Tell me if you can see the email claim somewhere in there and if yes show me where (just change any important data). |
|
Here you go Bruno - i replaced all private data but it looks like "email" field is carrying the UPN and "mail" is the correct one with the actual e-mail address:
|
|
Thank you. I updated the dev image again. Now it will print only the email and the mail fields, but I need you to test authenticating with one user who has an email claim and another user who doest not have an email claim.
|
|
Unfortunately I can't, if missing the email field is automatically populated with the UPN in Entra. It is nonly different if the email alias is added. "username@domain.com" // app/Livewire/Auth/OAuthLoginCallback.php:25 |
|
So, the second is always the correct email? |
|
Yes, the second is always the correct email |
|
|
|
I updated the dev image again. Now there are no more debugs, and I've added the other Microsoft provider as well. Test with the Azure first, since it is already configured. After that, you can test with the Microsoft provider using this: environment:
- MICROSOFT_CLIENT_ID=CLIENT_ID # change id
- MICROSOFT_CLIENT_SECRET=CLIENT_SECRET # change secret
- MICROSOFT_REDIRECT_URI=http://localhost/oauth/microsoft/callback # change domain
- MICROSOFT_PROXY=http://your-proxy-url # change url (optional configuration)You can use MICROSOFT_POST_LOGOUT_REDIRECT_URI if you are disabling local authentication. If this provider works well and you think it’s better, I’ll remove the other one. Let me know if everything is working as expected. |
|
The only thing that matters is the provider's ability to authenticate users. I don't mind using one provider or the other, as long as it works. The extra stuff is not relevant for authentication. |
|
Hi Bruno my apologies I could not find the chance to test the other provider. The other stuff is only relevant to use group permission mapping from the IdP. The AZURE driver is working perfectly for all kinds of users, so for the current purposes, it is perfectly good. |
|
No problem. I want to finish something else but I expect to release this in the next few days. I'll let you know when it's done. Thank you. |
|
This feature is now available in today's release v0.15.0. Make sure to change the |
Uh oh!
There was an error while loading. Please reload this page.
Hello
is it possible to use EntraID as an Oauth provider?
All reactions