Class: Basecamp::Oauth::ExchangeRequest

Inherits:
Data
  • Object
show all
Defined in:
lib/basecamp/oauth/exchange_request.rb

Overview

Parameters for exchanging an authorization code for tokens.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token_endpoint:, code:, redirect_uri:, client_id:, client_secret: nil, code_verifier: nil, use_legacy_format: false) ⇒ ExchangeRequest

Returns a new instance of ExchangeRequest.



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/basecamp/oauth/exchange_request.rb', line 23

def initialize(
  token_endpoint:,
  code:,
  redirect_uri:,
  client_id:,
  client_secret: nil,
  code_verifier: nil,
  use_legacy_format: false
)
  super
end

Instance Attribute Details

#client_idString (readonly)

The client identifier

Returns:

  • (String)

    the current value of client_id



14
15
16
# File 'lib/basecamp/oauth/exchange_request.rb', line 14

def client_id
  @client_id
end

#client_secretString? (readonly)

The client secret (optional for public clients)

Returns:

  • (String, nil)

    the current value of client_secret



14
15
16
# File 'lib/basecamp/oauth/exchange_request.rb', line 14

def client_secret
  @client_secret
end

#codeString (readonly)

The authorization code received from the authorization server

Returns:

  • (String)

    the current value of code



14
15
16
# File 'lib/basecamp/oauth/exchange_request.rb', line 14

def code
  @code
end

#code_verifierString? (readonly)

PKCE code verifier (optional)

Returns:

  • (String, nil)

    the current value of code_verifier



14
15
16
# File 'lib/basecamp/oauth/exchange_request.rb', line 14

def code_verifier
  @code_verifier
end

#redirect_uriString (readonly)

The redirect URI used in the authorization request

Returns:

  • (String)

    the current value of redirect_uri



14
15
16
# File 'lib/basecamp/oauth/exchange_request.rb', line 14

def redirect_uri
  @redirect_uri
end

#token_endpointString (readonly)

URL of the token endpoint

Returns:

  • (String)

    the current value of token_endpoint



14
15
16
# File 'lib/basecamp/oauth/exchange_request.rb', line 14

def token_endpoint
  @token_endpoint
end

#use_legacy_formatBoolean (readonly)

Use Launchpad's non-standard token format

Returns:

  • (Boolean)

    the current value of use_legacy_format



14
15
16
# File 'lib/basecamp/oauth/exchange_request.rb', line 14

def use_legacy_format
  @use_legacy_format
end