Module: Hitch::GrantTypes

Defined in:
lib/hitch/grant_types.rb

Overview

Which OAuth grants the token endpoint will actually accept right now.

One source of truth on purpose. Discovery metadata advertising a grant is a promise a conformant client will act on, so a hardcoded grant_types_supported that drifted from the endpoint's real behaviour would send clients to a door this server answers with unsupported_grant_type.

Constant Summary collapse

DEVICE_CODE =
"urn:ietf:params:oauth:grant-type:device_code"

Class Method Summary collapse

Class Method Details

.supportedObject



16
17
18
19
20
21
# File 'lib/hitch/grant_types.rb', line 16

def supported
  types = [ "authorization_code" ]
  types << "refresh_token" if Hitch.configuration.refresh_tokens_enabled
  types << DEVICE_CODE if Hitch.configuration.device_authorization_enabled
  types.freeze
end