Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(auth): Add custom auth support for Google and GitHub providers #826

Merged
merged 6 commits into from
May 13, 2024

Conversation

andimarc
Copy link
Contributor

@andimarc andimarc commented Apr 25, 2024

Setup

The user must first create the necessary GitHub OAuth app and/or Google OAuth Client ID with the redirect URIs set to http://localhost:4280/.auth/login/github and http://localhost:4280/.auth/login/google respectively.

They must then add the "auth" configuration in their staticwebapp.config.json file and set the appropriate environment variables containing client ID and client secret values before running starting the SWA CLI.

GitHub Login

User clicks on "Log in with GitHub" link (http://localhost:4280/.auth/login/github), which redirects to https://github.com/login/oauth/authorize.

AppPage

User logs into GitHub if not already logged in.

GitHubLogin

User authorizes GitHub OAuth app if not already authorized for their account.

GitHubAuthorize

User is redirected back to the static web app.

GitHubLoggedIn

Google Login

User clicks on "Log in with Google" link (http://localhost:4280/.auth/login/google), which redirects to https://accounts.google.com/o/oauth2/v2/auth.

AppPage

User logs into Google if not already logged in.

GoogleLogin

User authorizes Google OAuth app if not already authorized for their account.

GoogleAuthorize

User is redirected back to the static web app.

GoogleLoggedIn

@github-actions github-actions bot added scope: core Issues happened a the ./src/core level scope: auth Issues related to the authentication emulator labels Apr 25, 2024
@mkarmark mkarmark merged commit e8e6003 into Azure:main May 13, 2024
27 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: auth Issues related to the authentication emulator scope: core Issues happened a the ./src/core level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants