microsoft / o365-moodle

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

B2C connection not working #2534

Open JorritDeKlerk opened 5 months ago

JorritDeKlerk commented 5 months ago

Using the latest versions of the plugins and after configuring B2C in Azure, it still is not quite clear to me if these wonderful plugins do even work with B2C or not.

Using IdP-type 'Other' and authorization/token endpoints like 'https://xxx.b2clogin.com/xxx.onmicrosoft.com/signin_and_signup/oauth2/v2.0/authorize' and with scope 'openid profile email' I'm getting an 'Could not get app or system token' when authenticating.

I dit manage to get it to work with the alternative auth_azureb2c plugin but that plugin is not up to date (and, as I understand, based on auth_oidc) so I think I configured things right on the Azure-side.

I just want SSO but it's not clear to me if the plugin does even work with B2C or there are changed needed in auth_oidc.

weilai-irl commented 3 months ago

Hi @JorritDeKlerk

I confirm the plugins don't work on B2C tenants out of the box. This is due to some differences between B2C and non-B2C tenants, mainly in claims available in access tokens and ID tokens.

With that said, we do have a few clients who use the plugins to integration Moodle and Microsoft B2C tenants with the help of some customisations. We have a plan to review the customisations applied across the sites with the aim to provide some out-of-the-box support for at least the SSO feature. We hope to carry out the work in the coming weeks/months.

I'll update this issue when the changes are ready.

Regards, Lai