A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://github.com/atmos/sinatra_auth_github below:

atmos/sinatra_auth_github: :lock: simple sinatra extension to authenticate users against github oauth

A sinatra extension that provides oauth authentication to github. Find out more about enabling your application at github's oauth quickstart.

To test it out on localhost set your callback url to 'http://localhost:9393/auth/github/callback'

The gist of this project is to provide a few things easily:

% gem install sinatra_auth_github
% gem install bundler
% bundle install
% GITHUB_CLIENT_ID="<from GH>" GITHUB_CLIENT_SECRET="<from GH>" bundle exec rackup -p9393

There's an example app in spec/app.rb.

Example App Functionality

You can simply authenticate via GitHub by hitting http://localhost:9393

You can check organization membership by hitting http://localhost:9393/orgs/github

You can check team membership by hitting http://localhost:9393/teams/42

All unsuccessful authentication requests get sent to the securocat denied page.

The extension also provides a simple way to access the GitHub API, by providing an authenticated Octokit::Client for the user.

def repos
  github_user.api.repositories
end

For more information on API access, refer to the octokit documentation.

Enterprise Authentication

Under the hood, the warden-github portion is powered by octokit. If you find yourself wanting to connect to a GitHub Enterprise installation you'll need to export two environmental variables.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4