-
Notifications
You must be signed in to change notification settings - Fork 136
Description
Before filing this issue, please ensure you're using the latest CLI by running swa --version
and comparing to the latest version on npm.
Are you accessing the CLI from the default port :4280
?
- No, I am using a different port number (
--port
) and accessing the CLI from that port - Yes, I am accessing the CLI from port
:4280
Make sure you are accessing the URL printed in the console when running
swa start
!
ℹ️ NOTE: Make sure to enable debug logs when running any swa
commands using --verbose=silly
Describe the bug
When using custom identify providers with OpenID Connect, we should be able to login using the URL
/.auth/login/
Refer to docs: https://learn.microsoft.com/en-us/azure/static-web-apps/authentication-custom?tabs=openid-connect%2Cinvitations#configure-a-custom-identity-provider
But since 1.1.8, when you login using that URL you get a 404 response.
Instead when you change the login URL to /.auth/login/customOpenIdConnectProviders, then it works. This is contrary to how the URL works in the cloud.
To Reproduce
Steps to reproduce the behavior:
- Create a new swa project from scratch
- Add
staticwebapp.config.json
file with below content in it.
{
"auth": {
"rolesSource": "/api/my/roles",
"identityProviders": {
"customOpenIdConnectProviders": {
"aadb2c": {
"registration": {
"clientIdSettingName": "AADB2C_PROVIDER_CLIENT_ID",
"clientCredential": {
"clientSecretSettingName": "AADB2C_PROVIDER_CLIENT_SECRET"
},
"openIdConnectConfiguration": {
"wellKnownOpenIdConfiguration": "https://AADB2C_PROVIDER_ISSUER_URL/.well-known/openid-configuration"
}
},
"login": {
"nameClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"scopes": [ "openid", "profile" ],
"loginParameterNames": []
}
}
}
}
}
}
- start the app using
swa start
- Go to http://localhost:4280/.auth/login/aadb2c
Expected behavior
Should get the emulator login screen with the provider name as aadb2c
Desktop (please complete the following information):
- OS: Windows
- Version 10
- Node Version 18
- SWA Cli version: 1.1.8