Repository is archived
No commit activity in last 3 years
No release in over 3 years
OAuth assertion flow patch for doorkeeper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 10.3

Runtime

 Project Readme

⚠️ NO LONGER MAINTAINED ⚠️
Use the official gem: https://github.com/doorkeeper-gem/doorkeeper-grants_assertion.


Doorkeeper Assertion Flow

Extension of https://tools.ietf.org/html/draft-ietf-oauth-assertions-18 for doorkeeper.

Installation

1. Add the gem to your Gemfile

gem 'doorkeeper'
gem 'doorkeeper_assertion_flow'

2. Include assertion in the grant_flows

grant_flows %w[assertion authorization_code implicit password client_credentials]

3. Configure resource_owner_from_assertion

resource_owner_from_assertion do
  p = params[:assertion] || {}

  oauth = UserOauth.find_by p.slice(
    :provider,
    :uid,
  )

  if oauth
    oauth.refresh_credentials p.slice(
      :token,
      :token_secret,
      :token_expires_at,
    )

    oauth.user_account if oauth.save
  end
end

License

This project is copyright by Creasty, released under the MIT lisence.
See LICENSE file for details.