microsoft / o365-moodle

Office 365 and Azure Active Directory plugins for Moodle
GNU General Public License v3.0
182 stars 136 forks source link

Usage of missing key 'upn' causes fallback to 'oidcuniqid' #212

Closed crishan closed 3 weeks ago

crishan commented 7 years ago

moodle-auth_oidc 3.2.0.1 (2016120501)

I already opened issue https://github.com/Microsoft/moodle-auth_oidc/issues/25 on the project site.

When logging into Moodle with a new user coming from Azure, the user name is determined by using a key called 'upn'. This key is not returned by Azure, so function 'handlelogin' falls back to key 'oidcuniqid'.

I figured out, that instead a key 'unique_name' is delivered by Azure. Using that key allows proper authentication flow during REST calls for example.

It might be possible, that this issue is related to https://github.com/Microsoft/moodle-auth_oidc/issues/12. We also use guest user, that are invited to our Active Directory since we want user from any kind of domain.

I am looking forward to your response and like to contribute if needed!

weilai-irl commented 3 weeks ago

I'm closing this issue since it has been so many years and the issue doesn't apply any more. There has been many changes over the years to determine the most appropriate token claim to use as Moodle username.