Azure / Azure/static-web-apps

403: Forbidden We need an email address or a handle from your login service.

Open
#857 9 comments 2 reactions 0 assignees View on GitHub
triaged
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Error message: 403: Forbidden We need an email address or a handle from your login service. To use this login, please update your account with the missing info. Learn more.
...when logging in.

Steps to reproduce the behavior:
* Set up SWA using React with plan "Standard", use Python functions for backend
* Set up B2C directory
* Use "web" and not SPA as type of application for the app registration
* Use local account with IDP "email" as identity provider
* Use user flows for defining the signup/login procedure
identity provider: email signup
user attributes: user name, email address
application claims: identity provider, email addresses
* Add "B2C_CLIENT_ID" and "B2C_CLIENT_SECRET" to configuration of SWA

staticwebapp.config.json

```
{
"routes": [
{
"route": "/login",
"allowedRoles": ["anonymous"],
"rewrite": "/.auth/login/b2c"
},
{
"route": "/logout",
"allowedRoles": ["authenticated"],
"rewrite": "/.auth/logout"
},
{
"route": "/.auth/login/aad",
"allowedRoles": ["anonymous", "authenticated"],
"statusCode": 404
},
{
"route": "/.auth/login/apple",
"allowedRoles": ["anonymous", "authenticated"],
"statusCode": 404
},
{
"route": "/.auth/login/b2c",
"allowedRoles": ["anonymous"]
},
{
"route": "/.auth/login/facebook",
"allowedRoles": ["anonymous", "authenticated"],
"statusCode": 404
},
{
"route": "/.auth/login/github",
"allowedRoles": ["anonymous", "authenticated"],
"statusCode": 404
},
{
"route": "/.auth/login/google",
"allowedRoles": ["anonyous", "authenticated"],
"statusCode": 404
},
{
"route": "/.auth/login/twitter",
"allowedRoles": ["anonymous", "authenticated"],
"statusCode": 404
},
{
"route": "/*",
"allowedRoles": ["authenticated"]
}
],
"navigationFallback": {
"rewrite": "/index.html",
"exclude": [
"/css/*",
"/img/*",
"/js/*"
]
},
"responseOverrides": {
"401": {
"statusCode": 302,
"redirect": "/login"
}
},
"auth": {
"identityProviders": {
"customOpenIdConnectProviders": {
"b2c": {
"registration": {
"clientIdSettingName": "B2C_CLIENT_ID",
"clientCredential": {
"clientSecretSettingName": "B2C_CLIENT_SECRET"
},
"openIdConnectConfiguration": {
"wellKnownOpenIdConfiguration": "https://lw.b2clogin.com/lw.onmicrosoft.com/B2C_1_lw_flow/v2.0/.well-known/openid-configuration"
}
},
"login": {
"nameClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"scopes": [],
"loginParameterNames": []
}
}
}
}
}
}
```

**Expected behavior**
User is logged in

**Device info (if applicable):**
MacOS, same error on all browsers tested (Chrome, Firefox, Safari)

The problem is mentioned in issue #413 but solution of @mkarmark is not applicable for my case. Running the user flow in the portal also produces the same error message

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.