Omniauth-Matique

Gem Version

OmniAuth Matique Strategy

Strategy to authenticate with matiq UG (haftungsbeschränkt) via OAuth2 in OmniAuth.

Installation

As usual:

# Gemfile
gem "omniauth-matique"

and run "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:

Miscellaneous

Copyright (c) 2016-2023 Dittmar Krall (www.matiq.com), released under the MIT license: