401 on callback after login with multitenant application
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Hi I am trying to configure authentication for my Static Web Application using a multi-tenant app registration.
The authentication flow seems to complete but results in a 401 during the final request for the callback endpoint.
My configuration works when using "https://login.microsoftonline.com//v2.0" but fails when using "https://login.microsoftonline.com/organizations/v2.0".
I have tried adding routing rules to explicitly allow access to the callback endpoint and fiddling with various configurations of my app registration and application config but to no avail.
Is there a lack of support for multi-tenant flows or am i doing something wrong?
My config is as follows:
```
{
"auth": {
"identityProviders": {
"azureActiveDirectory": {
"registration": {
"openIdIssuer": "https://login.microsoftonline.com/organizations/v2.0",
"clientIdSettingName": "AZURE_CLIENT_ID",
"clientSecretSettingName": "AZURE_CLIENT_SECRET"
}
}
}
},
"routes": [
{
"route": "/.auth/*",
"allowedRoles": ["anonymous"]
},
{
"route": "/test*",
"allowedRoles": ["authenticated"]
}
],
"responseOverrides": {
"401": {
"statusCode": 302,
"redirect": "/.auth/login/aad"
}
}
}
```
And then authentication settings on the app registrations are as follows:


Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.