0.0
No commit activity in last 3 years
No release in over 3 years
OmniAuth strategy for the Booker API using OAuth2
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0

Runtime

~> 1.5.2
<= 1.3.1, ~> 1.1
 Project Readme

Omniauth::Booker

An omniauth strategy for Booker

Codeship Status for HireFrederick/omniauth-booker

Usage

This gem may be used to generate an OAuth access_token and refresh_token for using Booker's API. See https://developers.booker.com for more info.

Add this line to your application's Gemfile:

gem 'omniauth-booker'

By default, this gem authorizes against Booker's API sandbox environment: https://apicurrent-app.booker.ninja/App/Admin/Login.aspx

When you are ready to use it in production, add BOOKER_OMNIAUTH_BASE_URL = https://signin.booker.com to your ENV

Example Middleware Configuration

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :booker, ENV['BOOKER_CLIENT_ID'], ENV['BOOKER_CLIENT_SECRET'], {
    scope: 'openid profile userinfo offline_access merchant'
  }
end

Example Auth Hash

Here's an example of an authentication hash available in the callback by accessing request.env["omniauth.auth"]:

{
  'provider' => :booker,
  'uid' => 4508508,
  'info' => {
    'name' => 'First Last',
    'location_id' => 10257,
    'user_name' => 'myusername',
    'account_name' => 'myaccountname',
    'user_type' => 2, 
    'roles' => 'Spa User:Admin'
  }, 
  'credentials' => {
    'token' => 'the_access_token',
    'refresh_token' => 'the_refresh_token',
    'expires_at' => 1483319048,
    'expires' => true
  },
  'extra' => {}
}