Open lfernandes00 opened 6 months ago
@NGPixel Can I get any feedback please?
@NGPixel If you can provide any feedback on this I would really appreciate it. I believe adding support for Azure Ad B2C auth would really be a quick win and a very nit feature addition to Wiki.js. Thanks in advance for your attention, let me know if anything is needed.
I was having problems trying to implement azure ad b2c user flow in Azure AD auth strategy. I kept getting the error "Invalid email / username or password on sign in".
After running some tests I found out that the issue came from the JWT sent by AZURE AD B2C auth which do not contain
email
orpreferred_username
claims expected by Azure AD authentication. The JWT from b2c returns the user email on an array claimemails
.I fix this by changing the following lines in
/server/modules/authentication/azure/authentication.js
file.I changed:
To:
Also, the JWT from B2C doesn't contain the
oid
claim. So I also change this lines to fix it:From:
To:
I tested everything and it worked as expected.
@NGPixel I'd like to get your feedback as soon as possible. Thank you!