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

Tony Dis 16 Reputation points
2021-07-21T15:58:32.143+00:00

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://video2.skills-academy.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
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
904 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tony Dis 16 Reputation points
    2021-07-22T13:04:52.52+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.