Azure B2C Custom Auth Provider doesn't seem to work
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I'm trying to configure Custom Auth Provider with Azure Static Web Apps while on the "Standard" Pricing Plan. I'm using Azure B2C as the auth provider as we want to allow our users from our b2c account to be able to login to this static web apps.
1. The index page is accessibile even though the allowedRoles is set to be "authenticated"
2. typing "./auth/login/aadb2c" in the browser returns 404



**below is my staticweapp.config.json file**
```
{
"routes": [
{
"route": "/login",
"rewrite": "/.auth/login/aadb2c"
},
{
"route": "/logout",
"redirect": "/.auth/logout",
"allowedRoles": ["authenticated"]
},
{
"route": "/.auth/login/twitter",
"statusCode": 404
},
{
"route": "/.auth/login/google",
"statusCode": 404
},
{
"route": "/.auth/login/aad",
"statusCode": 404
},
{
"route": "/*",
"allowedRoles": ["authenticated"]
}
],
"responseOverrides": {
"401": {
"statusCode": 302,
"redirect": "/.auth/login/aadb2c"
}
},
"navigationFallback": {
"rewrite": "index.html",
"exclude": [
"/src2/docs/images/*.{png,jpg,gif,ico}",
"/src2/docs/img/*.{png,jpg,gif,ico}",
"/*.{css,scss,js}"
]
},
"auth": {
"rolesSource": "/api/Roles",
"identityProviders": {
"customOpenIdConnectProviders": {
"aadb2c": {
"registration": {
"clientIdSettingName": "AADB2C_PROVIDER_CLIENT_ID",
"clientCredential": {
"clientSecretSettingName": "AADB2C_PROVIDER_CLIENT_SECRET"
},
"openIdConnectConfiguration": {
"wellKnownOpenIdConfiguration": "https://.b2clogin.com/.onmicrosoft.com/B2C_1_SiIn/v2.0/.well-known/openid-configuration"
}
},
"login": {
"nameClaimType": "emails",
"scopes": [],
"loginParameterNames": []
},
"enabled": true
}
}
}
}
}
```
**Expected behavior**
1. I'm expecting for the page to automatically navigate to the "login" URL since I configured the wildcard route allowedRoles to be "authenticated" but users can still access the page even though they are not authenticated
2. checking the "/.auth/me" shows this

3. Navigating to "/.auth/login/aadb2c" returns 404 not found

**Device info (if applicable):**
- Browser: Edge
**Additional context**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.