Given an azure function secured via AAD B2C with https://login.microsoftonline.com/tfp/MyTenantName.onmicrosoft.com/signinsingunp as issuer url, I can successfully authenticate a b2c user via msal.js app, where as if I try to update issuer url to my b2ctenant domain login url (because of this advise redirect URLs to b2clogin.com) and update authority in msal.js app to match domain(myapp.b2clogin.com/tfp/MyTenantName.onmicrosoft.com/signinsingunp), I am receiving 401 for same azure function, any advise will be appreciated.
Below are detailed setup details,
- Azure AD B2C Tenant
- Domain Name: MyTenantName.onmicrosoft.com
- Applications:
- ApplicationA-Api
- WebApp/API : Yes
- Allow Implicit Flow : Yes
- Reply Url : https://myazurefunsapi.azurewebsites.net/.auth/login/aad/callback
- App ID : https://MyTenantName.onmicrosoft.com/ApplicationA-Api
- Published Scopes : read, user_impersonation
- API Access : Access User Profile
- ApplicationB-Portal
- WebApp/API : Yes
- Allow Implicit Flow : Yes
- Reply Url : https://myportal.domain.com
- App ID : https://MyTenantName.onmicrosoft.com/ApplicationB-Portal
- Published Scopes : user_impersonation
- API Access : ApplicationA-Api (read, access this app on behalf of signed in user), Access User Profile (offline_access, openid)
- ApplicationA-Api
- User Flows
- SignupSignIn
- Application : ApplicationA-Api
- Reply Url : https://myazurefunsapi.azurewebsites.net/.auth/login/aad/callback
- Select Domain :
- MyTenantName.b2clogin.com
- login.microsoftonline.com
- SignupSignIn
- Applications:
- Domain Name: MyTenantName.onmicrosoft.com
- Azure Functions
- Authentication/Authorization
- App Service Authentication : On
- Action to take when not authenticated : Login with Azure AD
- Authentication providers :
- Azure AAD :
- Management Mode : Advanced
- client id : B2C-ApplicationA-ApplicationID
- issuer url : login.microsoftonline.com/......./opendid......
- Authentication/Authorization
- Static Website
- b2c integration done by msal.js (v0.2.4)
- clientID : B2C-ApplicationB-ApplicationID
- authority : https://login.microsoftonline.com/tfp/b2ctenantname.onmicrosoft.com/signinsingunp
- b2cscopes : ApplicationA-Api-read
Thanks in advance!