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

Development

~> 2.0.2
~> 12.3.3
~> 3.0

Runtime

 Project Readme

Omniauth::Segment

Gem Version

This gem contains the Segment strategy for OmniAuth.

For more information about the Segment Api authentication: https://segment.com/docs/partners/enable-with-segment/

Installation

Add this line to your application's Gemfile:

gem 'omniauth-segment'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-segment

Usage

If you are using rails, you need to add the gem to your Gemfile:

gem 'omniauth-segment'

You can pull them in directly from github e.g.:

gem "omniauth-segment", :git => "git://github.com/ferrucc-io/omniauth-segment.git"

Add provider in omniauth.rb along with CLIENT_ID and CLIENT_SECRET

e.g.

provider :segment, SEGMENT_CLIENT_ID, SEGMENT_CLIENT_SECRET, , { 
        callback_url: SEGMENT_CALLBACK_URL,
        scope: SEGMENT_SCOPE
    }

Obtain your CLIENT_ID/CLIENT_SECRET by registering your app on: https://segment.com/partners/integration/

After you have the gem running and the configuration is done, you can go to this url to log the user in:

http://localhost:3000/auth/segment

Where are the token and the source names?

From your callback controller you can find your token: request.env['omniauth.auth'].credentials.token and the source names: request.env['omniauth.auth'].info.source_names along with the rest information that Segment returns.

Now just follow the README at: https://github.com/omniauth/omniauth

Questions

For any question, fell free to send me a tweet @0xferruccio

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ferrucc-io/omniauth-segment.

License

The gem is available as open source under the terms of the MIT License.