Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Delegates OAuth authentication to other authentication server
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

 Project Readme

Rack::OauthProxy Build Status Code Climate Code Climate

Note

This project is archived because I no longer actively use it, and there seems to be no recent activity from other users either. If you are still using it and would like to take over maintenance, please contact me somewhere.

Delegates OAuth authentication to other authentication server.

Usage

For Rails example:

class BlogsController < ApplicationController
  use Rack::OauthProxy, url: "http://auth.example.com/oauth/token"

  before_action :require_authorization

  def show
    ...
  end

  private

  def require_authorization
    raise UnauthorizedError unless has_authorization?
  end

  # env["rack-oauth_proxy.response"] is a Faraday::Response object.
  def has_authorization?
    env["rack-oauth_proxy.response"].status == 200
  end
end