Skip to content

ferrucc-io/omniauth-segment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Omniauth Strategy for Segment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published