Skip to content

How to redirect to single-tenant Azure AD auth page for a static Jekyll site hosted on Static Web App? #701

@motoko89

Description

@motoko89

Hi all, I followed https://docs.microsoft.com/en-us/azure/static-web-apps/authentication-custom?tabs=aad and created the staticwebapp.config.json as below in the root folder:

{
  "routes": [
    {
      "route": "/*",
      "allowedRoles": ["authenticated"]
    }
  ],
  "auth": {
    "identityProviders": {
      "azureActiveDirectory": {
        "registration": {
          "openIdIssuer": "https://login.microsoftonline.com/my-tenant-id/v2.0",
          "clientIdSettingName": "AZURE_CLIENT_ID",
          "clientSecretSettingName": "AZURE_CLIENT_SECRET"
        }
      }
    }
  }
}

However, navigating to the site now just show:

401: Unauthorized

You don’t have permissions for this page. Please check your login info and permissions and try again. Learn more

How do I make the redirection to sign in page?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions