Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdate Office365 / Microsoft provider #376
Comments
This comment has been minimized.
This comment has been minimized.
In /var/app/current/node_modules/bell/lib/oauth.js Wreck.post(settings.provider.token, requestOptions, (err, tokenRes, payload) => { It assumes that payload object has access_token and refresh_token, but i have id_token and refresh_token instead when using office365 provider. Not sure why i dont get an access_token as response code is 200. |
This comment has been minimized.
This comment has been minimized.
I already get the access_token. The problem is that there the default scopes are note enough to get an access_token. I solved it adding 'User.Read'.
Now i get a 401 error while trying to retrieve the profile. I see the following error on the response headers.
Does this work only with paid office365 subscriptions or should it also work with free microsoft accounts? |
This comment has been minimized.
This comment has been minimized.
If i make an overkill scope declaration i access profile data. Im trying to find which are the minimum scopes to keep it working. |
This comment has been minimized.
This comment has been minimized.
It works using this scopes:
Ill try to test it with a paid account a bit later to check if there are any differences. |
This comment has been minimized.
This comment has been minimized.
Microsoft/Office oauth is a weird thing, I believe they have 3 versions now and it is super confusing which one to use :D |
This comment has been minimized.
This comment has been minimized.
Hi @AdriVanHoudt it actually took me a while to figure out how Bell works. There are two main protocols in the Microsoft cloud for authentication:
You can read about the difference here: https://docs.microsoft.com/en-us/azure/active-directory/develop/azure-ad-endpoint-comparison The way apps are registered for v1 and v2 is very different too, with separate portals. // EDIT |
This comment has been minimized.
This comment has been minimized.
Yeah, note that Bell atm doesn't have a provider that uses Azure AD v2 + MS graph api.
|
This comment has been minimized.
This comment has been minimized.
I've been playing around with a PR, but I'm getting this issue: By the way, I would recommend deprecating office365 and live, which are old and/or not implemented correctly. We should have, instead:
We could have "microsoft" as an alias of "azureadv2" The https://graph.microsoft.com/v1.0/me/ and https://outlook.office.com/api/v2.0/me endpoints don't include an email address unless the user has an active Office365 subscription, or if the account is sourced from an on-prem AD that includes the "mail" field. Workaround is to read the id_token. |
This comment has been minimized.
This comment has been minimized.
@ItalyPaleAle any progress? If you need help with a PR, open one so we can see where it is failing. |
This comment has been minimized.
This comment has been minimized.
@hueniverse I encountered a lot of issues, some with Bell itself (like above) and some with Azure, and ended up writing my own code that didn't use Bell. In particular, the issues with Azure are worth a discussion, as I believe there are some choices to be made:
|
This comment has been minimized.
This comment has been minimized.
Hmm nice and complex.
|
This comment has been minimized.
This comment has been minimized.
@ItalyPaleAle are you still up to champion this issue? |
This comment has been minimized.
This comment has been minimized.
I'm very low on bandwidth for writing code for this at the moment, but I can provide some guidance if anyone is willing to take this on. If you want a PR, I am not sure when I can find time to do this. I originally looked into this for a side project of mine, but ended up writing my own code as I was having too many issues with Bell. |
Im using bell version 8.8.0
I have github integration working but i have problems with office365. After i select a user it seems there is a problem obtaining the profile.
I checked the code on the latest version and seems none of the specific urls for office365 changed, so i assume version 8.8.0 should still work as other providers do.