diff --git a/CHANGELOG.md b/CHANGELOG.md index 2535d61bb..edc7c81b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ User-visible changes worth mentioning. Add your entry here. +- [#1715] Fix token introspection invalid request reason - [#1714] Fix `Doorkeeper::AccessToken.find_or_create_for` with empty scopes which raises NoMethodError - [#1712] Add `Pragma: no-cache` to token response diff --git a/lib/doorkeeper/oauth/token_introspection.rb b/lib/doorkeeper/oauth/token_introspection.rb index 4dca014ef..002c73cb0 100644 --- a/lib/doorkeeper/oauth/token_introspection.rb +++ b/lib/doorkeeper/oauth/token_introspection.rb @@ -6,7 +6,7 @@ module OAuth # # @see https://datatracker.ietf.org/doc/html/rfc7662 class TokenIntrospection - attr_reader :error + attr_reader :error, :invalid_request_reason def initialize(server, token) @server = server @@ -38,7 +38,6 @@ def to_json(*) private attr_reader :server, :token - attr_reader :invalid_request_reason # If the protected resource uses OAuth 2.0 client credentials to # authenticate to the introspection endpoint and its credentials are diff --git a/spec/controllers/tokens_controller_spec.rb b/spec/controllers/tokens_controller_spec.rb index 012c18622..9d029314a 100644 --- a/spec/controllers/tokens_controller_spec.rb +++ b/spec/controllers/tokens_controller_spec.rb @@ -536,7 +536,7 @@ expect(json_response).to match( "error" => "invalid_request", - "error_description" => an_instance_of(String), + "error_description" => I18n.t("doorkeeper.errors.messages.invalid_request.request_not_authorized"), ) end end