3

Simplifying Auth With Static Web Apps and React | LINQ to Fail

 3 years ago
source link: https://www.aaron-powell.com/posts/2020-12-21-simplifying-auth-with-static-web-apps-and-react/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Simplifying Auth With Static Web Apps and React

Monday, Dec 21, 2020 1 minute read Tags: javascript azure serverless

It’s no secret that I’m a fan of Azure Static Web Apps and I’m constantly looking for ways to make it easier for people to get working with it.

Something I hadn’t done much with until recently was work with the Authentication and Authorization aspect of it; I knew it was there, but I wasn’t building anything that required it.

While building a video chat app on Twitch I found myself jumping back and forth to the documentation to make sure that I was creating the login URLs correctly, loading the profiles, etc. and so it’s time to do something about it.

Introducing react-static-web-apps-auth

I created a npm package, @aaronpowell/react-static-web-apps-auth, which helps simplify development.

It introduces a component, <StaticWebAppsAuthLogins />, which will display all the auth providers (you can hide them by setting their corresponding prop to false), as well as a <Logout /> component and a React Context provider, <UserInfoContextProvider>, to give up access to the current user profile.

If you’re interested in the process of building it, I streamed that, including setting up a GitHub Actions pipeline with package deployment (like I blogged recently).

Leveling Up Online PresentationsPublished: 2020-12-21 15:57:41 +1100 +1100, Version: fe9d602

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK