Azure / Azure/static-web-apps

Azure Static Webapps is not creating custom authentication

Open
#1,038 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

Some well-known configurations are not correctly picked up for auth proxy creation.
Cannot provide it publicly, only in private, but it is a Keycloak OIDC config.

**To Reproduce**
Steps to reproduce the behavior:
1. Deploy the Azure SWA with staticwebapp.config.json like this:
```
{
"routes": [
{
"route": "/*",
"headers": {
"Cache-Control": "no-store"
}
}
],
"auth": {
"identityProviders": {
"customOpenIdConnectProviders": {
"keycloak": {
"registration": {
"clientIdSettingName": "KEYCLOAK_CLIENT_ID",
"clientCredential": {
"clientSecretSettingName": "KEYCLOAK_CLIENT_SECRET"
},
"openIdConnectConfiguration": {
"wellKnownOpenIdConfiguration": ""
}
},
"login": {
"nameClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"scopes": ["openid", "profile", "email"],
"loginParameterNames": []
}
}
}
}
},
"globalHeaders": {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, PUT"
}
}

```

`KEYCLOAK_CLIENT_ID` and `KEYCLOAK_CLIENT_SECRET` are correctly set up in Application Settings.
3. Wait for deploy to finish
4. Navigate to .auth/login/keycloak and see a 404 code

**Expected behavior**
Expected to see at least a login page from my keycloak provider

**Screenshots**
From diagnostics:
![Screenshot 2023-01-13 at 14 32 44](https://user-images.githubusercontent.com/13916665/212331801-88070b5f-536c-4fd5-9370-25e18eb92e47.png)

**Additional context and possible hints**
If I specify the separated auth, token, certs, issuer URLs, I can get a login page but the flows seems buggy and I can't get logged in in the end

**I can provide my SWA URL, tenant and well-known URL for further details in DM**

Thank you

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.