Giter VIP home page Giter VIP logo

devise-jwt's Introduction

Devise LULibrary JWT

Provides a simple devise authentication strategy for authenticating by JSON Web Tokens (JWTs) passed either as a GET parameter or as an Authorization header.

Designed to be used with our JWT Server package which provides a central server to authenticate users behind CoSign or similar service that provides a JWT to be used for authentication with other services.

Installation

Add this line to your application's Gemfile:

gem 'devise_lulibrary_jwt'

And then execute:

$ bundle

Or install it yourself as:

$ gem install devise_lulibrary_jwt

Usage

After installing the gem add the following to the model you wish to use for authentication.

devise :jwt_authenticatable, :authentication_keys => [:username], :jwt_create_user => true

The options of authentication_keys and jwt_create_user allow for multiple models to be used with different configuration options, be this using different authentication keys or changed whether the strategy only looks up a user compared to creating the user if they don't exist.

Within the global devise config the following options can be configured, the only required values are jwt_secret, jwt_issuer and jwt_audience.

Parameter Description
jwt_secret The secret used to verify the integrity of the JWT (required)
jwt_issuer The issuer of the JWT (required)
jwt_audience The audience for the JWT (required)
verify_aud Boolean for whether to verify the token audience (false allows for jwt_audience to be nil)
verify_iss Boolean for whether to verify the token issuer (false allows for jwt_issuer to be nil)
verify_iat Boolean for whether to verify the issued at timestamp of the token
jwt_create_user Boolean - Global option for whether to create a user if they don't exist (true) or to just find existing users (false). Can be overridden by setting :jwt_create_user on the devise config line of the model.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/lulibrary/devise_lulibrary_jwt.

License

The gem is available as open source under the terms of the MIT License.

devise-jwt's People

Contributors

stephenrob avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

devise-jwt'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.