zorn-v / nextcloud-social-login

GNU Affero General Public License v3.0
198 stars 137 forks source link

Could this be modified to work with Azure B2C? #315

Closed Jason9973 closed 1 year ago

Jason9973 commented 2 years ago

Hello Everyone,

So we have been working with the Azure B2C OpenID Implementation. SO as usual, MS does their own thing on standards. Anyways long story short, B2C standard flow is not exposing the Standard EMAIL Attribute. Instead it is exposing a String Collection called EMAILS... So normally in other applications I am calling EMAILS.0 which in our case is the desired value.. Is there a way in a future version of this App you could expose this attribute as a setting?

Thanks, Jason

zorn-v commented 2 years ago

I did not understand anything. Can you show raw example of requests/responses ? With cleared sensitive data of course.

Jason9973 commented 2 years ago

Hello,

I have attached a standard Response Token decoded from JWT.ms.. You can see the EMAILS attribute.

image

zorn-v commented 2 years ago

Same. Did not understand. How emails (it may changed) from some service can be identifiers as users ?

Blackclaws commented 2 years ago

I think the problem is the following:

By default if you want to use an email as the username you just use the email claim in the OIDC response (which should be a string).

In this case MS does not populate the email claim but instead creates a claim "emails" that is an array of string.

The question is whether it is possible to add a selector function that takes the token from OIDC and projects the username out of it. In this case the function would be "emails[0]".

Jason9973 commented 2 years ago

Blackclaws - That is precisely the issue and how I am working around it today.

Jason9973 commented 2 years ago

In WordPress World.. Here is an example OAuth Plugin where I can do this selection just as an idea..

image

Jason9973 commented 1 year ago

This is great. In which build will this be available? Thanks!