Deprecated alias for resource_req().
Use resource_req() for Bearer, DPoP, and mTLS-protected resource requests instead.
Usage
client_bearer_req(
token,
url,
method = "GET",
headers = NULL,
query = NULL,
follow_redirect = FALSE,
check_url = TRUE,
client = NULL,
token_type = NULL,
dpop_nonce = NULL,
resource_hosts = NULL,
oauth_client = NULL
)Arguments
- token
Either an OAuthToken object or a raw access token string.
- url
The absolute URL to call. Resource URLs must not exceed 8192 bytes, including the query and fragment, both before and after applying
query. This limit also applies whencheck_url = FALSE.- method
Optional HTTP method (character). Defaults to "GET". When the effective token type is
DPoP, this must be the final request method because the proof is signed against it.TRACEand the nonstandardTRACKmethod are rejected because authenticated requests could be reflected by the server and disclose credentials.- headers
Optional named list or named character vector of extra headers to set on the request. Header names are case-insensitive. Names must be unique HTTP field-name tokens, and values must not contain prohibited control characters. DPoP requests reject
Hostoverrides. This function manages theAuthorizationandDPoPheaders and ignores user-supplied replacements.- query
Optional named list of query parameters to append to the URL.
- follow_redirect
Logical or
NULL.FALSE(the default) disables HTTP redirects even whenshinyOAuth.allow_redirectis enabled.NULLinherits that global option (disabled by default).TRUEenables redirects. DPoP requests reject enabled redirects because each target needs a new proof.- check_url
Logical. If
TRUE(the default), validatesurlagainstis_ok_host()before attaching the access token. This rejects relative URLs, plain HTTP to non-loopback hosts, and whenoptions(shinyOAuth.allowed_hosts)is set, hosts outside the allowlist. Without an allowlist this performs HTTPS and URL-syntax validation only (with the configured non-HTTPS exceptions); any HTTPS host is accepted.FALSEskips this policy check; URL length and resource-host restrictions still apply.- client
Optional OAuthClient; required for DPoP or mTLS-bound tokens so the request can use the matching signing key or certificate and check any token-binding information.
- token_type
Optional override for the access token type when
tokenis supplied as a raw string. Supported values areBearerandDPoP. Invalid or multi-valued inputs are rejected. When omitted, shinyOAuth preservesOAuthToken@token_type, and may inferDPoPfrom explicitOAuthToken@cnf[["jkt"]]metadata. Raw access-token strings default toBearerunless you passtoken_type = "DPoP"explicitly.- dpop_nonce
Optional DPoP nonce to embed in the proof for this request. This is primarily useful after a resource server challenges with
DPoP-Nonce.- resource_hosts
Optional non-empty character vector of trusted resource host patterns, using
is_ok_host()matching rules. This call-scoped allowlist adds to the global policy and is enforced even ifcheck_urlisFALSE. It constrains the initial URL, not redirect destinations or resolved IPs.NULLadds no resource-specific policy.- oauth_client
Compatibility alias for
client. Supply only one spelling.
Value
Same value as resource_req().