I am having front-end as SPA (Angular 7) and backend as Azure Function Apps using Java.
I am using end-to-end authentication flow i.e. The user gets authenticated in the SPA. Then, to access the Function apps authorization token is used in the request.
I am using Azure AD B2C custom policy to authenticate the user. For custom policy, I am using local and social policy and modified as per my need.
Using custom policy, the user can log in as well as generate the authorization token. But in the function apps, we get below error
Error Failed to download OpenID configuration from 'https://mytenant.b2clogin.com/<b2c_tenant_id>/v2.0/.well-known/openid-configuration': The remote server returned an error: (404) Not Found.
Even I checked the results of the URL by putting directly in the browser and got the same result. I found that if I append ?p=poliy_name in the URL mentioned above, then I get the data.
Not sure what is wrong here.
You need to specify a policy in the URL always when dealing with B2C authentication flows. This should be the policy you use to authenticate the user.