• This repository has been archived on 08/Dec/2017
  • Stars
    star
    110
  • Rank 316,770 (Top 7 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 14 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An OAuth2 Provider for Rack-based apps (deprecated/not supported)

DEPRECATION NOTICE: This project is no longer supported. Doorkeeper or Songkick::Oauth2::Provider might offer the functionality you're looking for. We're keeping this repository around in case anyone is still relying on it, but note that there are a number of security vulnerabilities in the gem's dependencies as things stand, so use it at your own risk. If anyone wants to take over ownership of the repo, please get in touch.

oauth2-provider

Simple OAuth2 provider code extracted from hashblue.com

Details

  • Implements draft 11 of the oauth2 spec
  • Handles the authorization_code, password, and client_credential grant types
  • Supports ActiveRecord and Mongoid

Usage Instructions

In your Gemfile:

gem 'oauth2-provider', :git => '[email protected]:freerange/oauth2-provider.git'

If you're using ActiveRecord, grab the schema out of spec/schema.rb, and run the migration.

To dish out authorization codes you will need to implement something like this:

class AuthorizationController < ApplicationController
  include OAuth2::Provider::Rack::AuthorizationCodesSupport

  before_filter :authenticate_user!
  before_filter :block_invalid_authorization_code_requests

  def new
    @client = oauth2_authorization_request.client
  end

  def create
    if params[:yes].present?
      grant_authorization_code(current_user)
    else
      deny_authorization_code
    end
  end

end

And add a couple of routes:

match "/oauth/authorize", :via => :get, :to => "authorization#new"
match "/oauth/authorize", :via => :post, :to => "authorization#create"

oauth2-provider will handle requests to /oauth/access_token to handle conversion of authorization codes to access tokens.

More Repositories

1

mocha

A mocking and stubbing library for Ruby
Ruby
1,209
star
2

method_log

Trace the history of an individual method in a git repository (experimental)
Ruby
70
star
3

jam-coop

A platform co-operative for musicians and fans
Ruby
53
star
4

ais-on-sdr

Ruby
21
star
5

bank

An exploration of how to create a simple "bank" in the UK in c. 2014
15
star
6

google-drive-backup

Scheduled backup of Google Drive to AWS S3 bucket using rclone sync
TypeScript
15
star
7

goos-ruby

The example from "Growing Object-Oriented Software, Guided by Tests" written in Ruby
Ruby
9
star
8

freerange-puppet

Ruby
7
star
9

site

Go Free Range website
Ruby
7
star
10

free_agent

A small ruby library for accessing information from http://freeagentcentral.com
Ruby
4
star
11

harmonia-old

The precursor to Harmonia.io, here for posterity only.
Ruby
4
star
12

deploy

Enables simple git-based deployments to freerange-compatible hosts
Ruby
3
star
13

nodetest

A simple unit testing framework that's sympathetic to node.js
3
star
14

contracts

Standard contracts that we use
3
star
15

trello-reports

Ruby scripts for generating reports for a Trello board
Ruby
3
star
16

webhooks

Bi-directional integration between Harmonia & Trello
Ruby
2
star
17

aldermore-bank-to-freeagent

Reformat Aldermore Bank CSV to be suitable for upload to FreeAgent banking
JavaScript
2
star
18

heroku-cedar-em-resque-polling

Ruby
2
star
19

pair-programming-presentation

A presentation about Pair Programming
2
star
20

test_startup

Startup and shutdown methods for test/unit or shoulda in Ruby 1.8
Ruby
2
star
21

temporary

Testing moving a repository and all its bits to an organisation account.
Ruby
2
star
22

hashblue-gem

A gem to access the hashblue API
Ruby
2
star
23

printer-bookmarks

A demonstration bookmark service for Printer
Ruby
2
star
24

hashblue-api-client

An example #blue API client
Ruby
2
star
25

freeagent_transaction_explainer

A Chrome Extension which helps explain bank transactions in FreeAgent
HTML
2
star
26

cotech-github-demo

How to add a new cooperative to the Jekyll version of the CoTech website (deprecated)
1
star
27

freerange-cli

Simple command line tools used by FreeRange
Ruby
1
star
28

flexmock-with-minitest

Demo of Flexmock/MiniTest integration
Ruby
1
star
29

iamdoingx

A native mac application to post a status update to PW
Objective-C
1
star
30

flexmock-with-testunit

Demo of FlexMock/Test::Unit integration
Ruby
1
star
31

request-db-dashboard

A dashboard viewer of data analyzed from request-log-analyzer
Ruby
1
star
32

jQuery-ChronoClass

jQuery plugin to add classes to elements depending on the time of day
JavaScript
1
star
33

cotech-website

Spike on Jekyll version of CoTech website (deprecated)
JavaScript
1
star
34

free_agent_sanity_check

This respository is DEPRECATED. See README for an explanation.
Ruby
1
star
35

freerange-beards

Go Free Range team hirsuteness
Ruby
1
star
36

rr-with-testunit

Demo of RR/Test::Unit integration
Ruby
1
star
37

sauron

The All Seeing Eye
Ruby
1
star
38

heroku-cedar-em-http-server

Ruby
1
star
39

rr-with-minitest

Demo of RR/MiniTest integration
Ruby
1
star
40

alexa-helper

A simple example Amazon Alexa handler written in JS and deployed to AWS Lambda using Serverless
JavaScript
1
star
41

action_controller_template_assertions_ticket_5247

Monkey patching action controller to fix rails lighthouse ticket 5247
Ruby
1
star
42

trello-backup

Backup Trello boards to S3 bucket
TypeScript
1
star
43

coop-model-documents

HTML translation of Co-operatives UK model governing documents
HTML
1
star