Note: aw_auth() is the primary function used for authorization. auth_oauth() and auth_jwt() should not be called directly, as these do not cache the token.

aw_auth(type = aw_auth_with(), ...)

auth_jwt(
  client_id = Sys.getenv("AW_CLIENT_ID"),
  client_secret = Sys.getenv("AW_CLIENT_SECRET"),
  private_key = Sys.getenv("AW_PRIVATE_KEY"),
  org_id = Sys.getenv("AW_ORGANIZATION_ID"),
  tech_id = Sys.getenv("AW_TECHNICAL_ID"),
  jwt_token = NULL,
  ...
)

auth_oauth(
  client_id = Sys.getenv("AW_CLIENT_ID"),
  client_secret = Sys.getenv("AW_CLIENT_SECRET"),
  use_oob = TRUE
)

Arguments

type

Either 'jwt' or 'oauth'. This can be set explicitly, but a best practice is to run aw_auth_with() to set the authorization type as an environment variable before running aw_auth()

...

Additional arguments passed to auth functions.

client_id

The client ID, defined by a global variable or manually defined

client_secret

The client secret, defined by a global variable or manually defined

private_key

The file path to private key for token signature (JWT auth only)

org_id

Organization ID from integration console (JWT auth only)

tech_id

Technical account ID from integration console (JWT auth only)

jwt_token

(Optional) A custom, encoded, signed JWT claim. If used, only client_id and client_secret are required.

use_oob

if FALSE, use a local webserver for the OAuth dance. Otherwise, provide a URL to the user and prompt for a validation code. Defaults to the value of the httr_oob_default default, or TRUE if httpuv is not installed.

Value

The path of the cached token. This is returned invisibly.

Functions

  • auth_jwt: Authenticate with JWT token

  • auth_oauth: Authorize via OAuth 2.0

See also