0.0
No commit activity in last 3 years
No release in over 3 years
WIP (wip.chat) OAuth 2 Strategy for OmniAuth.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.9

Runtime

 Project Readme

OmniAuth WIP

Gem Version

This gem contains the WIP (https://wip.chat) strategy for OmniAuth.

Before You Begin

You should have already installed OmniAuth into your app; if not, read the OmniAuth README to get started.

Now sign in into the WIP OAuth Applications page and create an application. Take note of your Application UID and Secret because that is what your web application will use to authenticate against the WIP API. Make sure to set a correct callback URL or else you may get authentication errors. Usually this is something like https://example.com/auth/wip/callback. NOTE: Callback URLs need to use HTTPS, except for localhost.

Using This Strategy

First start by adding this gem to your Gemfile:

gem 'omniauth-wip'

If you need to use the latest HEAD version, you can do so with:

gem 'omniauth-wip', github: 'marckohlbrugge/omniauth-wip'

Next, tell OmniAuth about this provider. For a Rails app, your config/initializers/omniauth.rb file should look like this:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :wip, "APPLICATION_UID", "SECRET"
end

Replace "APPLICATION_UID" and "SECRET" with the appropriate values you obtained earlier.

Authentication Hash

An example auth hash available in request.env['omniauth.auth']:

{
  :provider => "wip",
  :uid => "1",
  :info => {
    :name => "Marc Köhlbrugge",
    :username => "marc",
    :url => "https://wip.chat/@marc"
  },
  :credentials => {
    :token => "a1b2c3d4...", # The OAuth 2.0 access token
    :secret => "abcdef1234"
  },
  :extra => {
    :access_token => "", # An OAuth::AccessToken object
    :raw_info => {
      :name => "Marc Köhlbrugge",
      :username => "marc",
      :url => "https://wip.chat/@marc"
    }
  }
}