OmniAuth strategy for Yammer
Ruby
Permalink
Failed to load latest commit information.
lib bump 0.2.0 Oct 3, 2016
spec New ruby Oct 1, 2016
.gitignore Fixing csrf bug Oct 3, 2016
.ruby-version new rubies Mar 11, 2017
.travis.yml update testing for ruby 2.2 Mar 11, 2017
Gemfile fix perms Jan 30, 2014
LICENSE.txt fix perms Jan 30, 2014
README.md new config Dec 8, 2014
Rakefile fix perms Jan 30, 2014
omniauth-yammer.gemspec Fixing csrf bug Oct 3, 2016

README.md

OmniAuth Yammer

Build Status Code Climate

This gem contains the Yammer strategy for OmniAuth 1.0.

Supports the OAuth 2.0 server-side flow. Read the Yammer docs for more details: https://developer.yammer.com/authentication/#a-oauth2

Installing

Add to your Gemfile:

gem 'omniauth'
gem 'omniauth-yammer'

or even:

gem 'omniauth'
gem 'omniauth-yammer', :github => 'le0pard/omniauth-yammer'

Then bundle install.

Usage

OmniAuth::Strategies::Yammer is simply a Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.

Here's a quick example, adding the middleware to a Rails app in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :yammer, ENV['YAMMER_KEY'], ENV['YAMMER_SECRET']
end

For changing default domain in gem (for dev or testing purpose) use YAMMER_DOMAIN environment variable:

ENV['YAMMER_DOMAIN'] = 'https://staging.yammer.com'

Devise

Add this line to devise config:

config.omniauth :yammer, "Consumer key", "Consumer secret"

If you have this error:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Then you can fix this by setting valid cert:

wget http://www.cacert.org/certs/root.crt
cat root.crt >> lib/ca-bundle.crt

and edit devise config:

config.omniauth :yammer, "Consumer key", "Consumer secret", {:client_options => {:ssl => {:ca_file => "#{Rails.root}/lib/ca-bundle.crt" }}}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request