No commit activity in last 3 years
No release in over 3 years
Twitch.TV 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

>= 0
~> 2.7

Runtime

 Project Readme

OmniAuth Twitchtv

This gem contains a Twitchtv OAuth2 Strategy for OmniAuth.

Installation

Add to your Gemfile:

gem 'omniauth-twitchtv', github: 'masterkain/omniauth-twitchtv'

Then bundle install.

Usage

Add the config line below to application's Devise intitializer.

config.omniauth :twitchtv, Settings.twitchtv.client_id, Settings.twitchtv.client_secret, scope: Settings.twitchtv.permissions.join(" ")

Sample config:

config.omniauth :twitchtv, '4n6jy6klu89s300ap05t', 'a3d3dm9ag6s5an33p01', scope: 'user_read channel_editor channel_commercial channel_read'

Auth Hash

Here's an example Auth Hash available in request.env['omniauth.auth']:

{
  :provider => 'twitchtv',
  :uid => '1234567',
  :info => {
    :nickname => 'jmbloggs',
    :email => 'jm@bloggs.com',
    :name => 'jmbloggs',
    :image => 'http://static-cdn.jtvnw.net/jtv_user_pictures/jmbloggs-profile_image-e22f9c709cb15002-300x300.jpeg',
    :urls => {
      :twitchtv => 'https://www.twitch.tv/jmb0000/profile',
      :website => 'https://api.twitch.tv/kraken/users/jmb0000'
    },
    :partnered => false
  },
  :credentials => {
    :expires => false,
    :token => '897cacaca...',
    :secret => '8c2na7ca7and7...'
  },
  :extra => {
    :raw_info => {
      ...
    }
  }
}