0

I have a web app hosted on Azure Static Web App via Azure Devops. The app works fine but cannot get Azure Static Web App authorization to work.

The web app can be access via ...6bde6303 .1. azurestaticapps.net link

Authentication is supposed to be accessed via ...6bde6303.1.azurestaticapps.net/.auth/login/aad which redirects to identity. 1 .azurestaticapps.net/.redirect/aad?hostName=... - which is a 'cannot be reached' tipe of site.

I noticed that identity .1. azurestaticapps.net is not the correct link and tried changing url to identity.azurestaticapps.net instead - it then redirected me to the sign in page and worked. However, once signed in, it redirects back to identity. 1 .azurestaticapps.net. I think this is an issue with the subdomain and I think it is controlled in system files. I'm stuck and was hoping maybe someone figured this out?..

My staticwebapp.config.json looks like this

{
  "routes": [
      {   // redirect /login to the Active Directory endpoint for authentication. 
      "route": "/login",
      "rewrite": "/.auth/login/aad"
      },
      {   // Only allow people with the "reader" role to access ANY route.
      "route": "/docs",
      "allowedRoles": ["reader"]
      }    
  ],
  "responseOverrides": {
      "401": {    // If access is denied because of a missing role (=anonymous users), redirect them to login.
      "redirect": "/login",
      "statusCode": 302
      }
  },
  "mimeTypes": {
      ".json": "text/json"
  }
}
petrasb
  • 11
  • 1

1 Answers1

1

Figured it out - my antivirus software had identity.1.azurestaticapps.net URL for some reason blacklisted (whereas identity.azurestaticapps.net was not). Once I got it in the exception list - it works.

petrasb
  • 11
  • 1