Omniauth-Matique

Gem Version Build Status

OmniAuth Matique Strategy

Strategy to authenticate with matique UG via OAuth2 in OmniAuth.

Installation

Add to your Gemfile:

gem 'omniauth-matique'

Then bundle install.

Usage

Here's an example for adding the middleware to a Rails app (config/initializers/omniauth.rb):

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :matique, ENV["CLIENT_ID"], ENV["CLIENT_SECRET"]
end
OmniAuth.config.logger = Rails.logger

Here's an routing example for a Rails app (config/routes.rb):

match '/auth/:provider/callback', to: 'sessions#create', via: [:get, :post]
get '/auth/failure', to: 'sessions#failure'

get '/auth/login', to: 'sessions#new', as: :login
get '/auth/logout', to: 'sessions#destroy', as: :logout

You must take care about (see also sample "app"):

  • app/controllers/sessions_controller.rb
  • config/initializers/omniauth.rb

You can now access the OmniAuth Matique URL: /auth/matique

Credits

Inspiration from the web. See also:

Copyright (c) [Dittmar Krall], released under the MIT license.