Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Google authentication #30

Open
jeromegn opened this issue Jan 21, 2019 · 3 comments
Open

Google authentication #30

jeromegn opened this issue Jan 21, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@jeromegn
Copy link
Member

Protect some routes via a 3rd party auth system (in this case: Google.)

We had that with the old platform (sites), pretty sure it would still be useful.

@jeromegn jeromegn added the enhancement New feature or request label Jan 21, 2019
@nprail
Copy link

nprail commented Jan 22, 2019

I once made a POC of this sort of thing with Node.js. I'd be willing to share that code if interested.

@jeromegn
Copy link
Member Author

jeromegn commented Jan 23, 2019

@nprail sure, anything would help. There's probably a lot that won't work since we can't use the Crypto API from node.js (I'm assuming we'll have to sign some JWTs for Google).

But we already have the sjcl package which can probably do a lot of what we need. Until we have a more complete Crypto API (from the Web API.)

@nprail
Copy link

nprail commented Jan 24, 2019

@jeromegn Here is the code: https://github.com/nprail/static-auth-poc

It was a POC for improving auth on Surge.sh so some things would have to be modified. For example, it doesn't do Google login. It just has a static username and password in it. I think the login server piece of the POC can be completely replaced by an OAuth provider.

This is the basic flow:

  1. The user goes to a password protected site (e.g. protected.example.com)
  2. The user is redirected to the Login Server and logs in (which redirects to Google or any other provider for login)
  3. The user is redirected back to protected.example.com with the new JWT token stored in a cookie
  4. The JWT token is then used to verify that the user has access to the site

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants