In a doorkeeper-protected application, a controller could look like this:
class Api::V1::MyController < ApplicationController
before_action :doorkeeper_authorize!, only: %i[show create destroy]
...
end
However, when using Doorkeeper::JWT to generate access tokens this commonly used pattern breaks since a Doorkeeper::JWT token is just a string...
The before_action :doorkeeper_authorize! way of authenticating calls breaks here, because it expects a doorkeeper_token to implement the acceptable? method:
https://github.com/doorkeeper-gem/doorkeeper/blob/4dc432c74a424c85e141b131939faafa98a916fc/lib/doorkeeper/rails/helpers.rb#L16
I have only just started my sideproject and Doorkeeper is relatively new to me, but would it work if Doorkeeper::JWT tokens extend the token mixin?
https://github.com/doorkeeper-gem/doorkeeper/blob/v5.2.1/lib/doorkeeper/models/access_token_mixin.rb#L275
In a doorkeeper-protected application, a controller could look like this:
However, when using Doorkeeper::JWT to generate access tokens this commonly used pattern breaks since a Doorkeeper::JWT token is just a string...
The
before_action :doorkeeper_authorize!way of authenticating calls breaks here, because it expects adoorkeeper_tokento implement theacceptable?method:https://github.com/doorkeeper-gem/doorkeeper/blob/4dc432c74a424c85e141b131939faafa98a916fc/lib/doorkeeper/rails/helpers.rb#L16
I have only just started my sideproject and Doorkeeper is relatively new to me, but would it work if
Doorkeeper::JWTtokens extend the token mixin?https://github.com/doorkeeper-gem/doorkeeper/blob/v5.2.1/lib/doorkeeper/models/access_token_mixin.rb#L275