Giter Club home page Giter Club logo

Comments (3)

nprail avatar nprail commented on May 23, 2024

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

from edge.

jeromegn avatar jeromegn commented on May 23, 2024

@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.)

from edge.

nprail avatar nprail commented on May 23, 2024

@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

from edge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.