Skip to content
StackExchange OAuth strategy for OmniAuth
Latest commit 224f245 Sep 22, 2015 @nashby Update
Failed to load latest commit information.
lib version bump Sep 20, 2015
test initial Jun 27, 2012
.gitignore initial Jun 27, 2012
.travis.yml Update .travis.yml Sep 19, 2015 Update Sep 22, 2015
Gemfile initial Jun 27, 2012
LICENSE initial Jun 27, 2012 Modified to handle GET parameter for site Jul 16, 2012
Rakefile initial Jun 27, 2012
omniauth-stackexchange.gemspec initial Jun 27, 2012

OmniAuth StackExchange TravisCI

This gem contains the StackExchange strategy for OmniAuth.

StackExchange uses the OAuth2 flow, you can read about it here:

How To Use It

So let's say you're using Rails, you need to add the strategy to your Gemfile:

gem 'omniauth-stackexchange'

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

gem 'omniauth-stackexchange', :git => ''

Once these are in, you need to add the following to your config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :stackexchange, "client_id", "client_secret", public_key: "key", site: 'stackoverflow'

You will obviously have to put in your client_id, client_secret and public_key, which you get when you register your app with StackExchange (they call them Client Id, Client Secret and Key).

You will also need to specify a site option to uniquely identify the StackExchange site (e.g. stackoverflow or superuser) you wish to authenticate against. A list of valid site api keys can be found at It's stackoverflow by default.

If your application needs to be able to support multiple StackExchange sites, you can pass the site api key as the value for a GET parameter named sites (e.g. /auth/stackexchange?site=superuser)

Now just follow the README at:

Supported Rubies

OmniAuth StackExchange is tested under 1.9.3.


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


Copyright (c) 2012 by Vasiliy Ermolovich

Something went wrong with that request. Please try again.