question

TonyDis-5356 avatar image
0 Votes"
TonyDis-5356 asked TonyDis-5356 answered

Static Web App - override-pre-configured-provider (aad)

We have deployed a docusaurus documentation site (built with the React) as an Azure Static Web App. We initially set this up using the pre-configured aad provider, however this didn't allow us to restrict access to users only in our aad domain (it gave access to any MS user) .

The documentation says it is possible to do this by overriding the pre-configured (aad) provider.
We have followed the instructions on:
https://docs.microsoft.com/en-us/azure/static-web-apps/authentication-custom?tabs=aad#override-pre-configured-provider

We set up an app registration (we are familiar with app registrations so this was straight forward)

Set up auth in our staticwebapp.config.json, (clientIdSettingName and clientSecretSettingName substituted during deployment) see below and re-deployed

"auth": {
    "identityProviders": {
      "azureActiveDirectory": {
        "registration": {
          "openIdIssuer": "https://login.microsoftonline.com/-our tenant ID-/v2.0",
          "clientIdSettingName": "replaced in pipeline",
          "clientSecretSettingName": "replaced in pipeline"
        }
      }
    }
}


When we try to login we get 404 going to /login/aad and /.auth/login/aad
Can someone explain why this is happening.

Is there a step that we have missed?


azure-static-web-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TonyDis-5356 avatar image
1 Vote"
TonyDis-5356 answered

We decided to host this as an Azure App service instead - it took less than 30 minutes to set up an app service from scratch with authentication configured.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.