Sha256: fc542641b32412c013a23703d1141585b1cad3037d08e37d62cbd61d9191f430
Contents?: true
Size: 1.38 KB
Versions: 11
Compression:
Stored size: 1.38 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_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. 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. 5. Read the source, there are few features not mentioned in this README.
Version data entries
11 entries across 11 versions & 1 rubygems