Skip to contents

An oauth2_authorization_code_flow object describes the configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.

Usage

class_oauth2_authorization_code_flow(
  authorization_url = character(),
  token_url = character(),
  ...,
  refresh_url = character(),
  scopes = class_scopes()
)

Arguments

authorization_url

Character vector (required). The authorization URL to be used for this flow. This must be in the form of a URL. The OAuth2 standard requires the use of TLS.

token_url

Character vector (required). The token URL to be used for this flow. This must be in the form of a URL. The OAuth2 standard requires the use of TLS.

...

These dots are for future extensions and must be empty.

refresh_url

Character scalar (optional). The URL to be used for obtaining refresh tokens. This must be in the form of a URL. The OAuth2 standard requires the use of TLS.

scopes

An optional class_scopes() object with the available scopes for the OAuth2 security scheme.

Value

An oauth2_authorization_code_flow S7 object, with fields authorization_url, token_url, refresh_url, and scopes.

Examples

class_oauth2_authorization_code_flow(
  authorization_url = "https://example.com/authorize",
  token_url = "https://example.com/token",
  refresh_url = "https://example.com/refresh",
  scopes = class_scopes(
    name = c("server:read", "server:write"),
    description = c("Read server settings", "Write server settings")
  )
)
#> <rapid::oauth2_authorization_code_flow>
#>  @ refresh_url      : chr "https://example.com/refresh"
#>  @ scopes           : <rapid::scopes>
#>  .. @ name       : chr [1:2] "server:read" "server:write"
#>  .. @ description: chr [1:2] "Read server settings" "Write server settings"
#>  @ authorization_url: chr "https://example.com/authorize"
#>  @ token_url        : chr "https://example.com/token"