Giter VIP home page Giter VIP logo

fake-jwt-server's Introduction

fake-jwt-server Docker Hub pulls

โš ๏ธ This service is for local/development use only.

Small HTTP service that is meant to approximate some parts of the Auth0 browser based authentication flow for generating JSON Web Tokens (JWTs), to make development easier.

  • can use either the provided RSA key in private.pem for signing JWTs, or one randomly generated at startup
  • serves a JSON Web Key Set (JWKS) at /.well-known/jwks.json
  • /authorize offers up a HTML form for generating JWTs, that can also be prefilled with values from query parameters
  • POSTing to /authorize will respond with the signed JWT
  • POSTing to /authorize?redirect_uri=... will redirect to the specified redirect_uri with the JWT in the access_token field of the location.hash

Quickstart

go run cmd/fake-jwt-server/main.go

The server will listen on http://0.0.0.0:8080. To use a newly generated RSA key for the JWKS:

FAKE_JWT_SERVER_GENERATE_RSA_KEY=true go run cmd/fake-jwt-server/main.go

You could get a signed JWT that expires in ~1 year like so.

curl -X POST \
     -H "Content-Type: multipart/form-data" \
     -F "sub=auth0|fb8618e6-8639-454d-9f94-4496b0b224a8" \
     -F "scope=openid profile email" \
     -F "iat=$(date +%s)" \
     -F "exp=$(($(date +%s) + 31536000))" \
     -F "iss=http://localhost:8080" \
     -F "azp=example-azp" \
     -F "aud=http://localhost:3000" \
     http://localhost:8080/authorize

fake-jwt-server's People

Contributors

dependabot[bot] avatar jameshiew avatar

Stargazers

 avatar

Watchers

 avatar  avatar

fake-jwt-server's Issues

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.