Configure OAuth/OIDC client credentials and login settings
Source:R/classes__OAuthClient.R
oauth_client.RdCreate a client with the credentials assigned by your provider, the URL where
users return after login, and the permissions your app needs. Pass the result
to oauth_module_server().
Usage
oauth_client(
provider,
client_id,
client_secret = character(0),
redirect_uri,
enforce_callback_issuer = NULL,
scopes = character(0),
resource = character(0),
claims = NULL,
state_store = cachem::cache_mem(max_age = 300),
state_payload_max_age = 300,
state_entropy = 64,
state_key = random_urlsafe(128),
client_assertion_private_key = NULL,
client_assertion_private_key_kid = NULL,
client_assertion_alg = NULL,
client_assertion_audience = NULL,
mtls_client_cert_file = NULL,
mtls_client_key_file = NULL,
mtls_client_key_password = NULL,
mtls_client_ca_file = NULL,
mtls_certificate_bound_access_tokens = FALSE,
request_object_mode = c("parameters", "request", "request_uri"),
response_mode = NULL,
request_object_signing_alg = NULL,
request_object_audience = NULL,
request_object_encryption_alg = NULL,
request_object_encryption_enc = NULL,
request_object_encryption_kid = NULL,
request_object_ttl = 45,
request_object_nbf_skew = NULL,
dpop_private_key = NULL,
dpop_private_key_kid = NULL,
dpop_signing_alg = NULL,
dpop_require_access_token = NULL,
scope_validation = c("warn", "strict", "none"),
claims_validation = c("none", "warn", "strict"),
userinfo_jwt_required_time_claims = character(0),
required_acr_values = character(0),
introspect = FALSE,
introspection_checks = character(0),
authorization_server_mode = c("single", "multi_issuer", "multi_redirect_uri"),
authorization_server_redirect_uris = character(0),
dpop_require_observed_cnf = FALSE,
jarm_signed_response_alg = NULL,
jarm_encrypted_response_alg = NULL,
jarm_encrypted_response_enc = NULL,
jarm_decryption_private_key = NULL,
jarm_decryption_private_key_kid = NULL,
jarm_max_lifetime = 600,
endpoint_auth = list(),
mtls_require_observed_cnf = TRUE,
trusted_id_token_audiences = character(0),
compare_callback_issuer = NULL,
client_assertion_typ = "JWT",
authorization_method = "GET",
resource_bases = character(),
required_scopes = character(),
label = default_client_label(provider),
...,
introspect_elements = NULL
)Arguments
- provider
The service configuration, created with a provider helper such as
oauth_provider_google()oroauth_provider_oidc_discover().- client_id
The identifier assigned when you register your app with the provider.
- client_secret
The secret issued for your app, preferably read with
Sys.getenv(). Omit it for registrations that do not use a secret.It is required for
token_auth_style = "header". With"body"and PKCE, an empty secret is omitted. With"public"(alias"none"), it is never sent for client authentication. HMAC-signed ID token validation still requires a non-empty secret, regardless of the client authentication method.- redirect_uri
The URL where users return after login. It must match the callback URL registered with your provider, including scheme, host, port, and path. Use HTTPS in production.
- enforce_callback_issuer
Logical or
NULL. WhenTRUE, enforce that authorization responses handled through this client include an RFC 9207issparameter and reject callbacks unless it exactly matchesprovider@issuer. This is recommended when one callback URL can receive responses from more than one authorization server. Requires the provider to have a configuredissuer.When
NULL(theoauth_client()helper default), shinyOAuth auto-enables this check for providers that advertiseauthorization_response_iss_parameter_supported = TRUEand have a configuredissuer, such as OIDC discovery providers that expose RFC 9207 support. SetFALSEto opt out explicitly.- scopes
Character vector of permissions to request. The provider defines the available names. For OIDC (
issuerset andinfer_oidc_from_issuer = TRUE), shinyOAuth adds"openid"automatically if absent. The resulting set is used in the request and subsequent scope checks.- resource
Optional RFC 8707 resource indicator(s). Supply a character vector of absolute URIs to request audience-restricted tokens for one or more protected resources. Each value is sent as a repeated
resourceparameter on the authorization request, initial token exchange, and token refresh requests. Default ischaracter(0).- claims
Optional request for specific OIDC user information, beyond scopes. Default
NULLsends no request. Supply a list withuserinfoand/orid_tokenmembers, for examplelist(userinfo = list(email = list(essential = TRUE))). Useclaims_validation = "strict"if an unmet request must stop login.Lists are JSON-encoded with
auto_unbox = TRUE. UseNULLfor an unconstrained claim,valuefor one required value, orvaluesfor a set. Wrap a single-elementvaluesvector inI()to keep it a JSON array, for examplelist(values = I("example-acr")). A pre-encoded JSON string is also accepted. Your provider must support the OIDC claims parameter.- state_store
Storage for pending logins. The default
cachem::cache_mem(max_age = 300)is suitable for one R process. For multiple app processes, supply a sharedcustom_cache()with atomic[["take"]]()and use the samestate_keyon every process. Plaincachem::cache_disk()is unsafe for shared login state because its separate read and delete operations do not prevent simultaneous reuse. Seecustom_cache()for method and stored-value requirements.- state_payload_max_age
Maximum age of a pending login's encrypted state, in seconds. Default 300. This is checked separately from the state store's entry lifetime; both must allow the returning login.
- state_entropy
Length in characters of the random state identifier, from 22 to 128. Default 64. Most apps should keep the default.
- state_key
Secret used to encrypt and protect pending login details. A random key is generated when omitted. This is separate from
client_secretand is also used for public clients.For multiple R processes, supply the same key and shared
state_storeon every process. Accepts a character string or raw vector of at least 32 bytes. Generate it from cryptographically random bytes; do not use a memorable password. State uses AES-GCM authenticated encryption.- client_assertion_private_key
Optional private key for
private_key_jwtclient authentication at the token endpoint. Can be anopenssl::keyor a PEM string containing a private key. Required when the provider'stoken_auth_style = 'private_key_jwt'. Also used to sign JAR Request Objects, regardless of the token auth style. Current outbound private-key JWT signing supports RSA, EC, and Ed25519 private keys. RSA keys supportRS256and explicitly selectedRS384;RS512and RSA-PSS (PS256,PS384,PS512) are not supported. Ed25519 keys supportEd25519(RFC 9864) and legacyEdDSA(the default for compatibility); Ed448 is not supported.- client_assertion_private_key_kid
Optional key identifier (kid) to include in the JWT header for
private_key_jwtassertions and JAR Request Objects. Useful when the authorization server uses kid to select the correct verification key.- client_assertion_alg
Optional JWT signing algorithm to use for client assertions. When omitted, defaults to
HS256forclient_secret_jwt. Forprivate_key_jwt, a compatible default is selected based on the private key type/curve (e.g.,RS256for RSA orES256/ES384/ES512for EC P-256/384/521, orEdDSAfor Ed25519). If an explicit value is provided but incompatible with the key, validation fails early with a configuration error. When the provider advertisestoken_endpoint_auth_signing_alg_values_supported, both explicit values and inferred defaults must be included in that set. Supported values areHS256,HS384,HS512for client_secret_jwt and asymmetric algorithms supported for outbound signing (RS256,RS384,ES256,ES384,ES512, andEd25519or legacyEdDSAwith Ed25519 keys) for private keys.RS512,PS256,PS384, andPS512are not currently supported for outbound client assertions.- client_assertion_audience
Optional override for the
audclaim used when building JWT client assertions (client_secret_jwt/private_key_jwt). By default, shinyOAuth uses the active token, introspection, or revocation request URL. PAR uses the issuer when configured, otherwise the canonical PAR URL, including when the request uses an mTLS alias. Set an explicit value when required by the provider's registration agreement.- mtls_client_cert_file
Optional path to the PEM-encoded client certificate (or certificate chain) used for RFC 8705 mutual TLS (mTLS) client authentication and certificate-bound protected-resource requests. Required when
provider@token_auth_styleis"tls_client_auth"or"self_signed_tls_client_auth". The certificate matching the private key must appear first, followed by its issuers in chain order. CA-first bundles are rejected.- mtls_client_key_file
Optional path to the PEM-encoded private key used with
mtls_client_cert_file. Must be supplied together withmtls_client_cert_file, and is required for RFC 8705 mTLS client authentication.- mtls_client_key_password
Optional password used to decrypt an encrypted PEM private key referenced by
mtls_client_key_file.- mtls_client_ca_file
Optional path to a PEM CA bundle used to validate the remote HTTPS server certificate when making mTLS requests. This is mainly useful for local or test environments that use self-signed server certificates.
- mtls_certificate_bound_access_tokens
Logical. Whether this client intends to request RFC 8705 certificate-bound access tokens when the provider advertises that capability. Default is
FALSE.Set this to
TRUEfor clients that should prefer discoveredmtls_endpoint_aliaseson authorization-server requests even whentoken_auth_styleitself is not an mTLS auth style, and present the certificate on token and protected-resource requests. Certificate/key configuration alone does not enable this mode.Requires
mtls_client_cert_fileandmtls_client_key_file, and the provider must be configured withmtls_client_certificate_bound_access_tokens = TRUE. By default,mtls_require_observed_cnf = TRUEalso requires locally observable confirmation of the certificate binding. For opaque tokens whose binding is enforced only by the servers, keepmtls_certificate_bound_access_tokens = TRUEand setmtls_require_observed_cnf = FALSE.- request_object_mode
Controls how the authorization request is transported to the provider.
"parameters"(default): send OAuth parameters directly on the browser redirect URL."request": send a signed JWT-secured authorization request (JAR; RFC 9101) via therequestparameter."request_uri": publish a signed Request Object by reference and send its URL via therequest_uriparameter.
If the provider has a
par_url,"parameters"and"request"are sent to that endpoint first using Pushed Authorization Requests (PAR). The browser then receives the provider-issuedrequest_urihandle. Caller-published"request_uri"mode is separate from PAR and cannot be used when the provider requires PAR.Use a signed Request Object when the provider requires JAR or when it must verify the integrity of the authorization parameters.
"request_uri"lets the provider fetch the object from a published URL instead of carrying the JWT in the browser redirect. Both modes require signing material on the client. shinyOAuth prefersclient_assertion_private_keywhen present; otherwise it falls back to HMAC signing withclient_secret. When Request Object encryption is configured, shinyOAuth signs first and then wraps the signed Request Object in a JWE. Caller-managedrequest_uripublication requires HTTPS; HTTP URLs are rejected even when another configured host policy would otherwise allow them, as required by RFC 9101 Section 5.2. If the provider advertisesrequest_uri_registration_required = TRUE, caller-managedrequest_uripublication still depends on the provider having that URI or a matching wildcard prefix registered for the client; shinyOAuth cannot verify that server-side registration automatically.- response_mode
How the provider returns the login result. Leave
NULL(default) for a normal callback with parameters in the URL; noresponse_modeparameter is then sent. Use"query"to request that format explicitly, or"form_post"when your provider needs an HTTP POST. POST callbacks requireoauth_form_post_ui().Signed responses (JWT Secured Authorization Response Mode, JARM) use
"jwt","query.jwt", or"form_post.jwt"and requireoauth_module_server()."jwt"uses the query transport for this authorization-code flow."form_post.jwt"also needsoauth_form_post_ui().handle_callback()does not handle JARM. Requested modes must be inresponse_modes_supportedwhen advertised; fragment modes are not supported.- request_object_signing_alg
Optional JWS algorithm override for signed authorization requests when
request_object_modeuses a Request Object ("request"or"request_uri"). When omitted, shinyOAuth choosesHS256for HMAC-based signing or a compatible asymmetric default based onclient_assertion_private_key(for exampleRS256,RS384,ES256,ES384,ES512, orEdDSAfor Ed25519).RS512,PS256,PS384, andPS512are not currently supported for outbound signed authorization requests.- request_object_audience
Optional override for the
audclaim used in signed authorization requests. By default, shinyOAuth uses the provider issuer when available. Whenrequest_object_mode = "request"or"request_uri", the provider must have a configured issuer or you must supply an explicit override so the signed Request Object remains audience-bound to the intended authorization server.- request_object_encryption_alg
Optional JWE key-management algorithm override for encrypted Request Objects. Current outbound support is limited to
RSA-OAEP. When set, you must also setrequest_object_encryption_enc.- request_object_encryption_enc
Optional JWE content-encryption algorithm override for encrypted Request Objects. Current outbound support is limited to the AES-CBC-HMAC family (
A128CBC-HS256,A192CBC-HS384,A256CBC-HS512). When set, you must also setrequest_object_encryption_alg.- request_object_encryption_kid
Optional key identifier (
kid) used to select one provider encryption key and emit the outer JWEkidheader. This is mainly useful when the provider publishes more than one Request Object encryption key.- request_object_ttl
Positive number of seconds to keep signed authorization request objects (
requestJWTs) valid. Whenrequest_object_mode = "request_uri", shinyOAuth also uses this value as the default publication window for the referenced Request Object URI. Default is45.- request_object_nbf_skew
Optional non-negative number of seconds. When provided, shinyOAuth adds an
nbfclaim set toiat - request_object_nbf_skewso deployments can tolerate small clock skew while still emitting bounded request-object validity windows. LeaveNULL(the default) to omitnbf. Request-objectnbfis reserved by shinyOAuth and cannot be supplied through extra authorization parameters.- dpop_private_key
Private key for tying tokens to this app's requests using Demonstrating Proof of Possession (DPoP). Only needed when your provider/API supports DPoP. Accepts an
openssl::keyor PEM private-key string, using RSA, EC, or Ed25519.oauth_client()then defaultsdpop_require_access_tokentoTRUE. Supported signing algorithms areRS256,RS384,ES256,ES384,ES512, andEd25519or legacyEdDSAwith Ed25519 keys; RSA-PSS and other RSA signing algorithms are not supported for outgoing proofs. Seedpop_signing_algand the advanced security vignette.- dpop_private_key_kid
Optional key identifier (
kid) to include in the JOSE header of DPoP proofs. Useful when the authorization or resource server expects a stable key identifier alongside the embedded public JWK.- dpop_signing_alg
Optional JWT signing algorithm to use for DPoP proofs. When omitted, a compatible asymmetric default is selected based on the private key type/curve (for example
RS256,ES256,ES384, orES512, orEdDSAfor Ed25519).RS512,PS256,PS384, andPS512are not currently supported for outbound DPoP proofs. If an explicit value is provided but incompatible with the key, validation fails early with a configuration error. When the provider advertisesdpop_signing_alg_values_supported, both explicit values and inferred defaults must be included in that set.- dpop_require_access_token
Logical or
NULL. WhenTRUEanddpop_private_keyis configured, shinyOAuth requires the authorization server to returntoken_type = "DPoP"for access tokens and fails fast otherwise, independently of the access token's representation. Observed binding data must match the configured key; requiring its presence is a separate policy (dpop_require_observed_cnf). Inoauth_client(), the defaultNULLresolves toTRUEwhendpop_private_keyis configured and toFALSEotherwise. SetFALSEexplicitly only when you intentionally want to allow Bearer access tokens, such as deployments where DPoP is used only to bind refresh tokens.- scope_validation
Controls how scope discrepancies are handled when the authorization server grants fewer scopes than requested. RFC 6749 Section 3.3 permits servers to issue tokens with reduced scope, and Section 5.1 allows token responses to omit
scopewhen it is unchanged from the requested scope."warn"(default): Emits a warning but continues authentication if scopes are missing."strict": Throws an error if any requested scope is missing from the granted scopes. Omittedscopeis treated as unchanged, not as an error."none": Skips scope validation entirely.
- claims_validation
What to do if requested claims are missing or have unexpected values:
"warn"continues with a warning,"strict"stops login, and"none"skips the check. When omitted,oauth_client()uses"warn"ifclaimsincludesessential = TRUE,value, orvaluesrequirements, and"none"otherwise. Checks onclaims[["id_token"]]require ID token validation (id_token_validation = TRUEoruse_nonce = TRUE).- userinfo_jwt_required_time_claims
Optional character vector of temporal JWT claims that must be present when the UserInfo response is a signed JWT (
application/jwt). Allowed values are"exp","iat", and"nbf".Default is
character(0), which means these claims are validated only when present. Set, for example,userinfo_jwt_required_time_claims = "exp"to require an expiry on signed UserInfo JWTs, or pass multiple values to require additional temporal claims. For security-sensitive deployments that accept signed UserInfo JWTs, prefer requiring at least"exp".- required_acr_values
Optional character vector of acceptable login requirements, such as a provider's multi-factor authentication (MFA) policy. Use the provider's Authentication Context Class Reference (ACR) identifiers. The validated ID token must contain a matching
acror login fails. The request also sendsacr_valuesas a hint to the provider. Requiresid_token_validation = TRUEand anissuer. Defaultcharacter(0)imposes no requirement.- introspect
If
TRUE, ask the provider to confirm the access token is active before completing login and module refreshes. Requiresintrospection_url; an unsuccessful check or a response other thanactive = TRUEstops the operation. DefaultFALSE.- introspection_checks
Optional character vector of additional requirements to enforce on the introspection response when
introspect = TRUE. Supported values:"sub": require the introspectedsubto match the session subject (from a validated ID tokensubwhen available, else from userinfosub)."client_id": require the introspectedclient_idto match your OAuth client id."scope": validate introspectedscopeagainst requested scopes (respects the client'sscope_validationmode)."token_type": require introspection to returntoken_type. This is useful for sender-constrained deployments such as DPoP, where introspection can authoritatively reporttoken_type = "DPoP". Default ischaracter(0). (Note that not all providers may return each of these fields in introspection responses.)
Declares whether this client is part of an application that can interact with more than one authorization server, and which RFC 9700 mix-up defense it uses. One of:
"single"(default): the application uses only one authorization server, so RFC 9700 does not require a mix-up defense."multi_issuer": authorization responses identify their issuer. JARM response modes satisfy this requirement through their validatedissclaim. Direct response modes require the provider to advertiseauthorization_response_iss_parameter_supported = TRUE; shinyOAuth then requires and validates the RFC 9207issresponse parameter. Missing support metadata is treated as absence of this defense."multi_redirect_uri": each authorization server uses a distinct redirect URI. Supply the complete set throughauthorization_server_redirect_uris. This mode is supported byoauth_module_server(), which compares the browser-visible canonical scheme, authority, and path before parsing callback values.
Complete character vector of redirect URIs used by the application for its authorization servers when
authorization_server_mode = "multi_redirect_uri". It must contain at least two canonically distinct scheme/authority/path routes and include this client'sredirect_uri. Query and fragment components do not make routes distinct.- dpop_require_observed_cnf
Logical. When
TRUE, shinyOAuth rejectstoken_type = "DPoP"access tokens unless it can observecnf[["jkt"]]locally, from the token response, introspection, or optional JWT access-token inspection. Setoptions(shinyOAuth.access_token_cnf = "opaque")to disable access-token decoding for both DPoP and mTLS; the compatibility default"jwt"inspects JWTcnfwithout treating it as signature validation. Use this when high-assurance DPoP deployments must fail closed on opaque access tokens that provide no observable binding. Default isFALSE.- jarm_signed_response_alg
Optional expected JWS algorithm for signed JWT Secured Authorization Responses (JARM). When omitted and the effective response mode is JARM, shinyOAuth defaults to
RS256. This value is not sent dynamically on the authorization request; it must match the client metadata and provider behavior configured out-of-band for that client. Current inbound support acceptsHS256,HS384,HS512,RS256,RS384,RS512,ES256,ES384,ES512,Ed25519, andEdDSA. RSA-PSS (PS256,PS384,PS512) and unsecurednoneare not accepted for inbound JARM.- jarm_encrypted_response_alg
Optional expected JWE key-management algorithm for encrypted JARM responses. Current inbound support is limited to
RSA-OAEP. Likejarm_signed_response_alg, this reflects out-of-band client metadata and expected provider behavior rather than an authorization request parameter emitted by shinyOAuth.- jarm_encrypted_response_enc
Optional expected JWE content-encryption algorithm for encrypted JARM responses. Current inbound support is limited to the AES-CBC-HMAC family (
A128CBC-HS256,A192CBC-HS384,A256CBC-HS512). When omitted whilejarm_encrypted_response_algis set, shinyOAuth defaults toA128CBC-HS256. This must also match the provider-side JARM client metadata when encrypted responses are enabled.- jarm_decryption_private_key
Optional private key used to decrypt encrypted JARM responses. Can be an
openssl::keyor a PEM string containing a private key. Required when encrypted JARM is enabled.- jarm_decryption_private_key_kid
Optional key identifier (
kid) associated withjarm_decryption_private_key.- jarm_max_lifetime
Positive number of seconds. Maximum accepted lifetime for a JARM response JWT. Default is 600 seconds, matching JARM's recommended 10-minute upper bound for authorization response JWTs. When a JARM payload includes
iat, shinyOAuth enforcesexp - iat <= jarm_max_lifetime; otherwise it falls back to the remainingexpwindow at validation time. Applies only whenresponse_modeuses JARM.- endpoint_auth
Named list of authentication overrides for
par,introspection, andrevocation. Token exchange and refresh use the top-level client/provider authentication settings. Each entry may supplytoken_auth_style,client_secret,client_assertion_private_key,client_assertion_private_key_kid,client_assertion_alg,client_assertion_audience,client_assertion_typ,extra_headers(named character vector), and themtls_client_*certificate/key/CA fields. Introspection and revocation may also use a separateclient_id. Unspecified credentials inherit the client's settings. Discovered endpoint methods and signing algorithms are checked independently. PAR inherits token authentication. Extra token headers apply only to token exchange and refresh; setextra_headersexplicitly for every other endpoint that needs them.- mtls_require_observed_cnf
Logical, default
TRUE. Whenmtls_certificate_bound_access_tokens = TRUE, requirecnf[["x5t#S256"]]in the token response, JWT access token, or introspection and verify that it matches the configured certificate. The default preserves strict local assurance. SetFALSEfor server-enforced opaque bindings that the client cannot observe; this does not disable certificate presentation or mTLS endpoint selection. Missing confirmation is then allowed, but any observed confirmation is still validated, including mismatches and conflicting claims. This flag does not independently enable mTLS.- trusted_id_token_audiences
Character vector of additional ID-token audiences explicitly trusted by this client. Defaults to
character(0), which permits onlyclient_id. The token must always includeclient_idinaud; whenazpis present it must equalclient_id. Values are matched exactly and case-sensitively. Configure only audiences trusted for this application's identity tokens, not arbitrary API audiences.- compare_callback_issuer
Logical or
NULL. Compare any supplied callbackissexactly withprovider@issuer, while allowing absence whenenforce_callback_issuer = FALSE.NULLenables comparison when an issuer is configured, except whenenforce_callback_issuer = FALSEwas explicitly supplied. This preserves the existing complete opt-out. Setcompare_callback_issuer = TRUEwithenforce_callback_issuer = FALSEto check present values without requiring older providers to sendiss. Required issuer presence always enables comparison, even when this separate flag isFALSE. Validated JARM supplies its own issuer protection without requiring a redundant outeriss.- client_assertion_typ
JWT header
typfor client authentication. Defaults to"JWT"for existing providers. Use"client-authentication+jwt"withclient_assertion_audienceset to the provider's trusted issuer identifier for RFC7523bis-11 / OAuth 2.1 draft 16. The explicit type is recommended; it does not replace audience validation. This setting does not change JAR, JARM, ID token or DPoP types, or the OAuth form parameterclient_assertion_type.Browser method for sending the authorization request:
"GET"(default) or"POST". Select POST only after confirming provider support. It submits form fields instead of a long URL query. Use the module'srequest_login()orprepare_authorization_request(); URL-only helpers reject POST. This does not select the callbackresponse_modeor replace a provider's PAR or signed Request Object requirements.- resource_bases
Optional named character vector of approved API base URLs for
oauth_connection()andoauth_connections(). The defaultcharacter()leaves the existing token/request APIs unchanged. Each resource ID starts with a letter and contains letters, digits,_or-(at most 64 bytes). Up to 64 bases are supported. HTTPS is required except for loopback development URLs. Requests through a connection stay within the exact scheme, host, effective port and base path; redirects are disabled. Bases exclude user information, query strings, fragments, dot segments, repeated slashes, semicolon parameters and ambiguous encoded characters. This is local request policy, not evidence of token audience, and does not add the OAuthresourceauthorization parameter.- required_scopes
Optional requested scopes that every usable connection needs, default
character(). Other requested scopes may be absent from a limited grant. Ordinary OAuth clients compare literal scopes;smart_client()selects SMART semantic comparison and also enforces these permissions when validating token responses. Explicit refresh narrowing retains these scopes.- label
Optional display label used in connection summaries; defaults to the provider name, with control characters replaced by spaces and shortened to 128 UTF-8 bytes if needed. If the provider name is empty, missing or not a single string, the default is
"OAuth provider". Explicit labels must be non-empty strings of at most 128 bytes without control characters. Labels contain no credentials or patient context.- ...
Deprecated renamed arguments accepted temporarily for backward compatibility.
- introspect_elements
Compatibility alias for
introspection_checks. Supply only one spelling.
Value
OAuthClient object
Details
Create the client outside server() so its settings and pending login state
remain available when the callback returns. Configure provider, client_id,
client_secret (if issued), redirect_uri, and scopes from the app
registration. Use state_store and state_key for shared login state across
workers, and validation arguments to require particular scopes, claims, or
authentication context. See the usage vignette for a complete app, or
the advanced security vignette for certificate and signed-request settings.
Examples
# Register an app with GitHub and store its credentials in your environment.
# This creates the configuration; it does not start login or contact GitHub.
client <- oauth_client(
provider = oauth_provider_github(),
client_id = "your-client-id",
client_secret = "your-client-secret",
redirect_uri = "http://127.0.0.1:8100",
scopes = c("read:user", "user:email")
)
# In a real app, read credentials with Sys.getenv() and create client
# outside server(). Inside server(), start login with:
# auth <- oauth_module_server("auth", client)