Code Monkey home page Code Monkey logo

doorkeeper-jwt-test's Introduction

Doorkeeper-JWT-Test

What?

This is an example repo combining Rails API with the Doorkeeper admin UI, making use of Devise for login pages, admin auth, and password flows. The Doorkeeper tokens issued are JWTs with a payload + header that looks like this:

[{"iss": "account_service",
  "iat": 1527438897,
  "exp": 1527440097,
  "jti": "add3ef92-a512-429b-a834-3a3523866cdd",
  "sub": "account_service|1",
  "expires_at": "2018-05-27T16:54:57Z",
  "user": {"id": 1, "email": "[email protected]"}},
 {"typ": "JWT", "alg": "HS512"}]

Why?

Firstly I wanted to understand what was needed for SSO/OAuth2/JWT combo to work in the modern age, secondly everything else had some shortcomings either in usability or flexibility.

https://github.com/doorkeeper-gem/doorkeeper-devise-client

  • Using old versions, no JWT

https://github.com/digivizer/warden-jwt

  • Uses password flow strategy

https://github.com/waiting-for-dev/warden-jwt_auth

  • Is good but limits the JWT decode options

https://github.com/mbleigh/omniauth-jwt

  • Expects HTTP based on redirects for flow

https://github.com/betterup/devise-doorkeeper

  • No JWT support

How?

I cobbled together examples from all the above + the JWT spec + Auth0 articles. This is not a complete application and you shouldn't just drop it into your production env! YMMV, this is for reference only.

doorkeeper-jwt-test's People

Contributors

bookofgreg avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.