Package: shinyOAuth 0.7.0

Luka Koning

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.7.0.tar.gz
shinyOAuth_0.7.0.zip(r-4.7-any)shinyOAuth_0.7.0.zip(r-4.6-any)
shinyOAuth_0.7.0.tar.gz(r-4.7-any)shinyOAuth_0.7.0.tar.gz(r-4.6-any)
shinyOAuth_0.7.0.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://cran.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:

5.16 score 29 scripts 650 downloads 58 exports 43 dependencies

Last updated from:22e291c452. Checks:6 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-develOK225
source / vignettesOK244
linux-releaseOK217
windows-develOK215
windows-releaseOK194
wasm-releaseOK113

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_token_targetoauth_uiOAuthClientOAuthProviderOAuthTokenperform_client_bearer_reqperform_resource_reqprepare_authorization_requestprepare_callrefresh_tokenresource_reqrevoke_tokensmart_clientsmart_contextsmart_discoversmart_fhir_usersmart_launch_routesmart_patientuse_shinyOAuth

Dependencies:askpassbase64encbslibcachemcallrclicommonmarkcurldigestfastmapfontawesomefsgluehtmltoolshttpuvhttr2josejquerylibjsonlitelaterlifecyclemagrittrmemoisemimeopensslotelprocessxpromisespsR6rappdirsRcpprlangS7sassshinysourcetoolssystriebeardurltoolsvctrswithrxtable

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

Last update: 2026-10-31
Started: 2026-09-17

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 | Login and callbacks | Tokens and profiles | Sessions and saved connections | Error records

Last update: 2026-10-31
Started: 2025-11-09

Authentication flow
Overview | Starting login and binding it to the browser | Preparing the authorization request | Pending state and expiry | Authorization at the provider | Receiving and validating the callback | Transaction checks | Several authorization servers | Exchanging the code for tokens | Validating identity and profile information | ID token checks | Introspection and UserInfo | Publishing authentication state | Asynchronous execution | Refresh, reauthentication and logout | Token refresh | Expiry and maximum login age | Logout and revocation | Optional protocol extensions | Audit trail

Last update: 2026-10-31
Started: 2025-11-09

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-31
Started: 2025-11-09

Keep and use multiple OAuth authorizations
Why keep several 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 | Disconnecting a service | Deployment notes | Keep an ordinary OIDC login alongside SMART connections

Last update: 2026-10-31
Started: 2026-09-17

OpenTelemetry logs and traces
Overview | Exporter configuration | Traces and event correlation | Logging and tracing options | Protecting diagnostic data | Authorization metadata privacy | Asynchronous workers | Advanced diagnostic fields | Error attributes and redaction | Span catalog

Last update: 2026-10-31
Started: 2026-05-23

Package options reference
What package options are for | Set an option at app startup | Logging | HTTP settings (timeout, retries, user agent) | Async timeout (mirai) | Async condition replay | Token lifetime fallback | Validation and URL policy | State store | Size caps | State envelope | Callback query | Configuration assessments | Local debugging | Advanced transport constraints | Advanced parameter overrides

Last update: 2026-10-31
Started: 2026-09-17

Usage
Overview | Provider, client, and token objects | GitHub app registration | Minimal Shiny module example | Authentication state and user information | Manual login and logout buttons | Authenticated API requests | Asynchronous execution | Token expiry and session length | Provider configuration and OIDC discovery | Deployment | Callback and browser behavior | Advanced deployment | Posit Connect and Connect Cloud | Multiple R processes | Local Keycloak development | Further configuration

Last update: 2026-10-31
Started: 2025-11-09

Use one login for several APIs
One login, different API tokens | Configure two APIs | Choose a token when making a call | Refresh and sign in again | Microsoft example | Advanced: provider support and declaration limits | Identity and refresh-consent scopes | Advanced: Microsoft permissions and consent | Resource identifiers and scope names | Static permissions and unusual short names | Advanced: concurrent refreshes and failures | Request customization and background work

Last update: 2026-10-31
Started: 2026-10-31

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 | Granular permissions and refresh

Last update: 2026-10-31
Started: 2026-09-17

Use your Shiny login with other R packages
Reuse a login in another package | A complete Shiny example | Refresh and signing in again | SDK token callbacks and database drivers | Several accounts and optional profile retrieval | Advanced: connection lifetime and permissions | Reducing permissions and replacing a login | Advanced: asynchronous token acquisition | Handling token errors | Advanced: background tasks and saved results

Last update: 2026-10-31
Started: 2026-10-31

Readme and manuals

Help Manual

Help pageTopics
Review an OAuth client configuration before deploymentcheck_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
Validate an OAuth 2.0 callback and retrieve tokenshandle_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
Wrap an existing reactive token as a connectionoauth_connection
Create a process-local store for retained OAuth connectionsoauth_connection_store_memory print.OAuthConnectionStore
Manage several OAuth connections in one Shiny appoauth_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
Configure sign-in with authentikoauth_provider_authentik
Configure sign-in with an Amazon Cognito user pooloauth_provider_cognito
Create a GitHub OAuthProvideroauth_provider_github
Configure sign-in with GitLaboauth_provider_gitlab
Configure sign-in with Globus Authoauth_provider_globus
Create a Google OAuthProvideroauth_provider_google
Configure sign-in with Hugging Faceoauth_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
Configure researcher sign-in with ORCIDoauth_provider_orcid
Create a Slack OAuthProvider (via OIDC discovery)oauth_provider_slack
Create a Spotify OAuthProvideroauth_provider_spotify
Configure institutional sign-in with SURFconextoauth_provider_surfconext
Declare an API token targetoauth_token_target
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