Giter Club home page Giter Club logo

omniauth-openshift's Introduction

omniauth-openshift

This is an Omniauth stategy for authenticating users against OpenShift, useful when writing applications for users of OpenShift (as opposed to users of apps deployed on OpenShift). For example, custom self-service monitoring, provisioning or similar capabilities.

Installing

gem install omniauth-openshift

Example Configuration

To configure this provider you will need a couple things:

  1. A list of scopes needed for OCP access
  2. The public master url (site below)
  3. The url for the deployed app with the full path that OpenShift should redirect the user to (redirect_uri below)
  4. A client id and secret that are registered with OpenShift as an OAuthClient. An example is included below.
Rails.application.config.middleware.use OmniAuth::Builder do
  provider :openshift, {
    scope: ['user:full', 'user:info'],
    response_type: :code,
    client_id: 'example-client',
    client_secret: 'super-secret',
    client_options: {
      redirect_uri: 'http://myapp.paas.example.com/auth/openshift/callback',
      site: 'https://master.example.com:8443/'
    }
  }
end

OAuthClient Example

The following yaml can be used to register an oauth client with OpenShift.

apiVersion: v1
grantMethod: auto
kind: OAuthClient
metadata:
  name: example-client
redirectURIs:
- http://myapp.paas.example.com/auth/openshift/callback
secret: super-secret

Note that the name in the OAuthClient is the client_id for OmniAuth, and the secret is the client_secret. Additionally, redirect URIs must be identical.

omniauth-openshift's People

Contributors

cpitman avatar

Stargazers

 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.