Giter Club home page Giter Club logo

oidc_provider's Introduction

OIDCProvider

A Rails engine for providing OpenID Connect authorization. Uses the openid_connect gem to turn a Rails app into an OpenID Connect provider.

Usage

Use your application as an Open ID provider.

You'll need some kind of user authentication to exist on you application first. Normally we use Devise.

Installation

Add this line to your application's Gemfile:

gem 'oidc_provider'

And then execute:

$ bundle

Or install it yourself as:

$ gem install oidc_provider

Install the support stuffs:

  • an initializer
  • default routes to your routes file
$ rails generate oidc_provider:install

Migrations next:

$ rails oidc_provider:install:migrations
$ rails db:migrate

Private Key

You will need to generate a unique private key per application.

$ ssh-keygen

Due to Docker Composes' lack of support for multiline .env variables, put a passphrase on it. Then add the key to your application at lib/oidc_provider_key.pem and add the passphrase as an environment variables in your application: ENV["OIDC_PROVIDER_KEY_PASSPHRASE"].

Testing

Visit: https://demo.c2id.com/oidc-client/

Click "Client details"

Copy and paste the client ID, secret, and redirection URI into your config/initializers/oidc_provider.rb config for a new client.

Testing Provider Details

Visit: https://demo.c2id.com/oidc-client/

Click "OpenID provider details"

Put in your website as the issuer and click "Query"

You should see values generated for all 4 endpoints below.

Testing Access

Visit: https://demo.c2id.com/oidc-client/

Click "Authenticate end-user"

Click "Log in with OpenID Connect". You should see the following headings:

  • OpenID authentication response
  • Token response
  • Provider public RSA JSON Web Key (JWK)
  • ID token
  • UserInfo (with your email in there)

Contributing

Contribution directions go here.

License

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

How to build this gem

gem build oidc_provider.gemspec
gem push oidc_provider-0.3.2.gem

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.