Sha256: c427347091620aa941d32bdb24e58c35a9c5ffc88d20ca370a3f23b118ef2c02
Contents?: true
Size: 1.52 KB
Versions: 3
Compression:
Stored size: 1.52 KB
Contents
-1. Get familiar with OmniAuth by Intridea: http://github.com/intridea/omniauth. Read about OAuth2. 0. Obtain client_id and client_secret for your app from Exvo. 1. Install exvo-auth gem or add it to your Gemfile. 2. Configure middleware(s). There are two middlewares. Usually you will need the "interactive" one: ExvoAuth::Strategies::Interactive ExvoAuth::Strategies::NonInteractive Both middlewares need client_id and client_secret arguments. In Rails, the relevant line could look like this: config.middleware.use ExvoAuth::Strategies::Interactive, :client_id => "client_id, :client_secret => "client_secret" 3. Add routes. The following comes from Rails config/routes.rb file: match "/auth/failure" => "sessions#failure" match "/auth/interactive/callback" => "sessions#create" match "/auth/non_interactive/callback" => "sessions#create" Failure url is called whenever there's a failure (d'oh). You can have separate callbacks for interactive and non-interactive callback routes but you can also route both callbacks to the same controller method like shown above. 4. Include controller helpers into your application controller. include ExvoAuth::Controllers::Rails (or Merb) 5. Implement callback(s). Sample implementation in SessionsController: def create render :text => params[:auth].inspect end In short: you get params[:auth]. Do what you want to do with it: store the data, create session, etc. 6. Read the source, there are few features not mentioned in this README.
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
exvo-auth-0.5.1 | README |
exvo-auth-0.5.0 | README |
exvo-auth-0.4.3 | README |