Skip to content

A repository which highlights samples for Azure Static Web Apps with Authentication implemented in NextJS and ReactJS.

Notifications You must be signed in to change notification settings

styava/swa_samples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A repository which highlights samples for Azure Static Web Apps with Authentication implemented in NextJS and ReactJS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 68.6%
  • CSS 17.5%
  • HTML 9.6%
  • JavaScript 4.3%