Package: shinyOAuth 0.6.1.9000

shinyOAuth: OIDC Authentication and OAuth Authorization for 'shiny' Applications

Provides a simple, configurable framework for 'OpenID Connect' (OIDC) authentication and 'OAuth 2.0' authorization in 'shiny' applications using 'S7' classes. Defines providers, clients, and tokens, as well as various supporting functions and a 'shiny' module. Features include cross-site request forgery (CSRF) protection, state encryption, 'Proof Key for Code Exchange' (PKCE) handling, validation of OIDC identity tokens (nonces, signatures, claims), automatic user info retrieval for OIDC and supported 'OAuth' providers, asynchronous flows, and hooks for audit logging.

Authors:Luka Koning [aut, cre, cph]

shinyOAuth_0.6.1.9000.tar.gz
shinyOAuth_0.6.1.9000.zip(r-4.7-any)shinyOAuth_0.6.1.9000.zip(r-4.6-any)shinyOAuth_0.6.1.9000.zip(r-4.5-any)
shinyOAuth_0.6.1.9000.tgz(r-4.6-any)shinyOAuth_0.6.1.9000.tgz(r-4.5-any)
shinyOAuth_0.6.1.9000.tar.gz(r-4.7-any)shinyOAuth_0.6.1.9000.tar.gz(r-4.6-any)
shinyOAuth_0.6.1.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
shinyOAuth/json (API)

# Install 'shinyOAuth' in R:
install.packages('shinyOAuth', repos = c('https://lukakoning.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/lukakoning/shinyoauth/issues

Pkgdown/docs site:https://lukakoning.github.io

On CRAN:

Conda:

8.16 score 29 stars 29 scripts 657 downloads 57 exports 40 dependencies

Last updated from:34956603d5. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK254
source / vignettesOK246
linux-releaseOK257
macos-releaseOK157
macos-oldrelOK164
windows-develOK213
windows-releaseOK254
windows-oldrelOK254
wasm-releaseOK110

Exports:check_oauth21client_bearer_reqcustom_cacheerror_on_softenedget_userinfohandle_callbackintrospect_tokenis_ok_hostoauth_account_owneroauth_browser_owneroauth_clientoauth_client_mtls_registrationoauth_client_secret_appleoauth_connectionoauth_connection_store_memoryoauth_connectionsoauth_connections_serveroauth_connections_uioauth_form_post_uioauth_module_serveroauth_provideroauth_provider_appleoauth_provider_auth0oauth_provider_authentikoauth_provider_cognitooauth_provider_githuboauth_provider_gitlaboauth_provider_globusoauth_provider_googleoauth_provider_huggingfaceoauth_provider_keycloakoauth_provider_microsoftoauth_provider_oidcoauth_provider_oidc_discoveroauth_provider_oktaoauth_provider_orcidoauth_provider_slackoauth_provider_spotifyoauth_provider_surfconextoauth_uiOAuthClientOAuthProviderOAuthTokenperform_client_bearer_reqperform_resource_reqprepare_authorization_requestprepare_callrefresh_tokenresource_reqrevoke_tokensmart_clientsmart_contextsmart_discoversmart_fhir_usersmart_launch_routesmart_patientuse_shinyOAuth

Dependencies:askpassbase64encbslibcachemclicommonmarkcurldigestfastmapfontawesomefsgluehtmltoolshttpuvhttr2josejquerylibjsonlitelaterlifecyclemagrittrmemoisemimeopensslotelpromisesR6rappdirsRcpprlangS7sassshinysourcetoolssystriebeardurltoolsvctrswithrxtable

Advanced security configuration
Overview | Browser binding and deployment boundary | Provider metadata and OIDC discovery | JWT client authentication | Issuer comparison and transport policy | Callback pages and application scripts | Provider key-set validation | Trusted ID-token audiences | Mutual TLS (mTLS) | JWT-secured authorization request (JAR) | Request Objects published by the Shiny app | Pushed authorization requests (PAR) | Form Post response mode | Deployment behind an HTTPS proxy | JWT-secured authorization response mode (JARM) | Demonstrating proof-of-possession (DPoP) | Token binding requirements and validation | DPoP in API requests | Signature and encryption support

Last update: 2026-10-22
Started: 2026-05-28

Package options reference
Logging | Validation and URL policy | Advanced parameter overrides | Async timeout (mirai) | Async condition replay | Token lifetime fallback | HTTP settings (timeout, retries, user agent) | State store | Size caps | State envelope | Callback query | Local debugging

Last update: 2026-10-22
Started: 2026-09-05

Usage
Overview | GitHub app registration | Minimal Shiny module example | Provider, client, and token objects | Authentication state and user information | Manual login and logout buttons | Authenticated API requests | Additional token response fields | Provider configuration and OIDC discovery | Assessing OAuth 2.1 configuration | Multiple authorization servers | Requests bound to a client and resource | Asynchronous execution | Token expiry and session length | Deployment | Posit Connect and Connect Cloud | Multiple R processes | Security checklist | Troubleshooting | Further configuration

Last update: 2026-10-22
Started: 2025-10-27

OpenTelemetry logs and traces
Overview | Exporter configuration | Traces and event correlation | Logging and tracing options | Asynchronous workers | Error attributes and redaction | Authorization metadata privacy | Span catalog | Span: shinyOAuth.module.init | Span: shinyOAuth.login.request | Span: shinyOAuth.login.par | Span: shinyOAuth.login.par.http | Span: shinyOAuth.callback | Span: shinyOAuth.form_post | Span: shinyOAuth.form_post.bridge | Span: shinyOAuth.callback.validate | Span: shinyOAuth.callback.worker | Span: shinyOAuth.token.exchange | Span: shinyOAuth.token.exchange.http | Span: shinyOAuth.token.verify | Span: shinyOAuth.userinfo | Span: shinyOAuth.userinfo.http | Span: shinyOAuth.refresh | Span: shinyOAuth.refresh.worker | Span: shinyOAuth.logout | Span: shinyOAuth.session.end.revoke | Span: shinyOAuth.token.revoke | Span: shinyOAuth.token.revoke.http | Span: shinyOAuth.token.revoke.worker | Span: shinyOAuth.token.introspect | Span: shinyOAuth.token.introspect.http | Span: shinyOAuth.token.introspect.worker

Last update: 2026-10-19
Started: 2026-04-25

Authentication flow
Overview | What happens during the authentication flow? | 1. First page load: set a browser token | 2. Decide whether to start login | 3. Build the authorization request | State storage and expiry | Signed and pushed authorization requests (JAR and PAR) | 4. Redirect the browser to the provider | 5. User signs in and authorizes access | 6. Provider returns the browser to the app | HTTP POST callbacks (form_post) | Signed authorization responses (JARM) | 7. Validate the callback and login state | Browser binding and account validation | Multiple authorization servers | 8. Exchange the authorization code for tokens | Client certificates and certificate-bound tokens (mTLS) | Tokens bound to a signing key (DPoP) | 9. Validate the ID token (OIDC) | Signature and claim checks | Requested claims and authentication context (ACR) | 10. Build the OAuthToken object | 11. Check whether the token is active (optional introspection) | 12. Fetch user information (optional) | Signed UserInfo responses | UserInfo with mTLS or DPoP | 13. Mark the session as authenticated | 14. Clean up the callback URL and browser state | 15. Manage the authenticated session | Token refresh | ID tokens during refresh | Refreshing mTLS and DPoP tokens | Reauthentication | Expiry and refresh failures | 16. Logout and token revocation

Last update: 2026-10-18
Started: 2025-10-27

Example: Spotify login to display listening data
Overview | Spotify app registration | Shiny app example | API requests and scopes | Full dashboard example

Last update: 2026-10-16
Started: 2025-10-27

Keep and use multiple OAuth authorizations
Client configuration and connections | Register two clients | 1. Configure clients outside server() | 2. Keep authorizations when the browser returns | 3. Select a connection and make a request | Requests, permissions and refresh | Keep an ordinary OIDC login alongside SMART connections

Last update: 2026-10-05
Started: 2026-09-14

Audit logging and hooks
Overview | Receiving audit events | Authentication outcomes | Event structure | HTTP context and redaction | Audit events from asynchronous workers | Digest keys across R processes | Event catalog | Authorization redirect issuance | Event: audit_redirect_issued | Callback query rejected | Event: audit_callback_query_rejected | Callback routing rejected | Event: audit_callback_routing_rejected | Callback issuer validation | Event: audit_callback_iss_missing | Event: audit_callback_iss_mismatch | Event: audit_callback_iss_validation_failed | Callback received | Event: audit_callback_received | Callback validation | Event: audit_callback_validation_success | Event: audit_callback_validation_failed | State store access | Event: audit_state_store_lookup_failed | Event: audit_state_store_removal_failed | Token exchange | Event: audit_token_exchange | Event: audit_token_exchange_error | Token introspection | Event: audit_token_introspection | Login result | Event: audit_login_success | Event: audit_login_failed | Logout and session clears | Event: audit_logout | Event: audit_connection_disconnected | Event: audit_connections_disconnected | Event: audit_session_cleared | Token revocation | Event: audit_token_revocation | Refresh failures while keeping the session (indefinite sessions) | Event: audit_refresh_failed_but_kept_session | Browser cookie/WebCrypto error | Event: audit_browser_cookie_error | Invalid browser token | Event: audit_invalid_browser_token | Token refresh | Event: audit_token_refresh | Userinfo fetch | Event: audit_userinfo | State parsing failures | Event: audit_state_parse_failure | Error response state consumption | Event: audit_error_state_consumed | Event: audit_error_state_consumption_failed | Module/session lifecycle | Event: audit_session_started | Event: audit_session_ended | Event: audit_session_ended_revoke | Authentication state changes | Event: audit_authenticated_changed | Error events | Event: error | Event: http_error | Event: transport_error

Last update: 2026-09-29
Started: 2025-10-27

External SDKs and database drivers
A single-authorization app | SDK callbacks and databases | Refresh, async work and recovery | Several authorizations and optional UserInfo | Background tasks and result ownership

Last update: 2026-09-29
Started: 2026-09-29

Several API tokens from one authorization
Declare calendar and contacts targets | Use the same connection interface in either module | Microsoft configuration

Last update: 2026-09-29
Started: 2026-09-29

Use SMART on FHIR from Shiny
FHIR and SMART on FHIR | Before running the example | 1. Discover the server and configure the client | 2. Configure retained connections | 3. Authorize and fetch the patient | Search with the same connection | Patient context and user identity are different | Start from an EHR instead | More than one hospital | Other registration and refresh options

Last update: 2026-09-19
Started: 2026-09-14

Readme and manuals

Help Manual

Help pageTopics
Assess an OAuth configuration against a pinned OAuth 2.1 draftcheck_oauth21
Alias for 'resource_req()'client_bearer_req
Create a custom state store or signing-key cachecustom_cache
Fetch a user's profile (UserInfo)get_userinfo
Handle OAuth 2.0 callback: verify state, swap code for token, verify tokenhandle_callback
Introspect an OAuth 2.0 tokenintrospect_token
Check a URL against the package's host policyis_ok_host
Configure ownership of retained OAuth connectionsoauth_account_owner oauth_browser_owner print.OAuthOwnerPolicy
Configure OAuth/OIDC client credentials and login settingsoauth_client
Prepare client-certificate registration settings (mTLS)oauth_client_mtls_registration
Create a client secret for Sign in with Appleoauth_client_secret_apple
Make API requests with a Shiny session's current OAuth credentialsoauth_connection
Create a process-local store for retained OAuth connectionsoauth_connection_store_memory print.OAuthConnectionStore
Configure several independently managed OAuth connectionsoauth_connections print.OAuthConnections
Connect, restore and use several OAuth authorizations in a Shiny sessionoauth_connections_server
Handle callbacks and establish the connection owner's browser sessionoauth_connections_ui
Wrap a Shiny UI to enable OAuth 2.0/OIDC form_post callbacksoauth_form_post_ui
OAuth 2.0 authorization and OIDC authentication module for Shinyoauth_module_server
Configure OAuth/OIDC provider endpoints and validation settingsoauth_provider
Create an Apple OAuthProvideroauth_provider_apple
Create an Auth0 OAuthProvider (via OIDC discovery)oauth_provider_auth0
Create an authentik OAuthProvider (via OIDC discovery)oauth_provider_authentik
Create an Amazon Cognito OAuthProvider (via OIDC discovery)oauth_provider_cognito
Create a GitHub OAuthProvideroauth_provider_github
Create a GitLab OAuthProvider (via OIDC discovery)oauth_provider_gitlab
Create a Globus Auth OAuthProvideroauth_provider_globus
Create a Google OAuthProvideroauth_provider_google
Create a Hugging Face OAuthProvider (via OIDC discovery)oauth_provider_huggingface
Create a Keycloak OAuthProvider (via OIDC discovery)oauth_provider_keycloak
Create a Microsoft (Entra ID) OAuthProvideroauth_provider_microsoft
Create a generic OpenID Connect (OIDC) OAuthProvideroauth_provider_oidc
Discover and create an OpenID Connect (OIDC) OAuthProvideroauth_provider_oidc_discover
Create an Okta OAuthProvider (via OIDC discovery)oauth_provider_okta
Create an ORCID OAuthProvider (via OIDC discovery)oauth_provider_orcid
Create a Slack OAuthProvider (via OIDC discovery)oauth_provider_slack
Create a Spotify OAuthProvideroauth_provider_spotify
Create a SURFconext OAuthProvider (via OIDC discovery)oauth_provider_surfconext
Set up a Shiny UI for shinyOAuthoauth_ui
OAuthClient S7 classOAuthClient
OAuthConnection R6 classOAuthConnection
OAuthProvider S7 classOAuthProvider
OAuthToken S7 classOAuthToken
Alias for 'perform_resource_req()'perform_client_bearer_req
Call an API with an access tokenperform_resource_req
Prepare a browser authorization request using GET or POSTprepare_authorization_request
Prepare an OAuth 2.0 authorization request and build its URLprepare_call
Refresh an OAuth 2.0 tokenrefresh_token
Prepare an API request with an access tokenresource_req
Revoke an OAuth 2.0 tokenrevoke_token
Configure a SMART on FHIR app registrationsmart_client
Read a connection's current SMART contextsmart_context smart_fhir_user smart_patient
Discover SMART on FHIR server metadatasmart_discover
Register a SMART EHR launch entry routesmart_launch_route
Add JavaScript dependency to the UI of a Shiny appuse_shinyOAuth