Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 1.3 KB

readme.md

File metadata and controls

55 lines (42 loc) · 1.3 KB

Azure SWA Samples with Authentication

This sample is brought to you by

Styava Logo

You can join our Discord Servers from this link.

This repository contains two samples of

  1. React Sample
  2. NextJs Sample

The samples show an application with which you can log in and logout from different providers.

This sample showcases sample staticwebapp.config.json which has routes mentioned in it. The json file is same for both the samples but you can change it according to your preferences.

The contents of the file looks like this

{
  "routes": [
      {
          "route": "/.auth/login/aad",
          "statusCode": 404
      },
      {
          "route": "/.auth/login/github",
          "statusCode": 404
      },
      {
          "route": "/login",
          "rewrite": "/.auth/login/twitter"
      },
      {
          "route": "/logout",
          "rewrite": "/.auth/logout"
      }
  ]
}

The file states that routes of aad and github authentication is pointed towards 404 i.e. they are disabled. This file also makes the routes

/.auth/login/twitter as /login

and

/.auth/logout as /logout

both the samples use the same route to login and logout via the inbuilt Azure SWA Authentication.