Skip to content

OpenID Connect

Job van Koeveringe edited this page Nov 18, 2026 · 6 revisions

OpenID Connect

This page documents the protocol behavior and deployment requirements of the Scouting OpenID Connect integration.

Provider and flow

The plugin uses the Scouting Nederland issuer:

https://login.scouting.nl

It retrieves the provider discovery document from the issuer's .well-known/openid-configuration endpoint and uses the discovered authorization, token, UserInfo, signing-key, and logout endpoints.

The login flow is Authorization Code Flow with PKCE using the S256 challenge method. The provider must advertise S256 support. Each authorization request includes a random state value, nonce, PKCE verifier, and PKCE challenge.

Redirect and logout URIs

The plugin uses the WordPress home URL with a trailing slash as its redirect URI. Register the exact same public URL in the managed website connection:

https://example.org/

Register the post-logout redirect URI there too. Differences in scheme, host, path, port, or trailing slash can cause the provider to reject the login or logout request.

Scopes and claims

The plugin supports these scopes:

Scope Claims and behavior
openid Enables OpenID Connect authentication.
membership Provides the SOL member ID used as the local username.
profile Provides name, locale, profile URL, birthdate, and gender information.
email Provides the email address for the WordPress account.
address Provides optional address data.
phone Provides optional phone data.
roles Provides organizations, units, role definitions, and dated user assignments for local authorization.

openid, membership, profile, and email are required for the normal login and account lifecycle. address and phone are needed only when their matching profile storage options are enabled.

The optional roles scope powers SOL role mapping and WooCommerce SOL Access. Role data is synchronized from validated UserInfo during OIDC login. Removing the scope does not clear previously stored assignments, but immediately makes them unavailable for authorization. Complete a fresh successful OIDC login after restoring the scope to make synchronized assignments available again.

ID token and UserInfo validation

Before a user is signed in, the plugin:

  1. Requires an ID token with exactly three JWT segments and an RS256 algorithm.
  2. Finds the signing certificate for the token kid in the provider JWKS and verifies the signature.
  3. Verifies the issuer, audience, expiry, issued-at time, subject, and nonce.
  4. Calls the discovered UserInfo endpoint using the access token.
  5. Requires the UserInfo sub to match the validated ID token subject.
  6. Clears one-time authorization values and rotates the OIDC session identifier after successful login.

The discovery document and JWKS are cached for one hour. See Architecture for a broader view of the flow.

Logout

On WordPress logout, the plugin attempts to send the browser to the provider's discovered end-session endpoint. It includes the stored ID token as an id_token_hint when available. When no usable provider logout URL or ID token is available, it falls back to the WordPress home URL.

Login duration and returning visitors

SOL login creates a persistent WordPress login, equivalent to Remember Me. WordPress defaults to 14 days; other plugins or the auth_cookie_expiration filter can change this. Closing the browser does not normally end that login. The plugin's separate one-hour OIDC cookie and transients hold login-flow data; they do not set the WordPress login lifetime.

Returning with a valid WordPress cookie does not fetch fresh UserInfo or recheck provider-side access. Profile and SOL role synchronization happen during the OIDC login flow, not on every visit or on a background schedule.

HTTPS and reverse proxies

OIDC login requires the browser-facing site to use HTTPS. The plugin sets a secure, host-only cookie for OIDC request state, so a plain HTTP request cannot start an OIDC login.

Configure HTTPS in the WordPress runtime

The plugin uses WordPress' is_ssl() result. Configure the reverse proxy, hosting platform, or container image so WordPress recognizes the browser-facing HTTPS connection before it loads. This makes WordPress create secure core cookies and generate HTTPS URLs as well as allowing the plugin to create its OIDC cookie.

For example, the official Docker WordPress images already set HTTPS when the runtime receives X-Forwarded-Proto: https. No plugin-specific proxy IP or hostname setting is required in that setup.

For another deployment platform, use its supported reverse-proxy integration or the WordPress reverse-proxy guidance. Verify the result through WordPress Site Health and by confirming that is_ssl() is true for an externally HTTPS request.

Proxy security requirements

Never trust X-Forwarded-Proto from arbitrary clients. The trusted proxy must:

  • Remove any client-supplied forwarding headers before forwarding the request.
  • Set X-Forwarded-Proto itself according to the browser-facing connection.
  • Be the only component allowed to connect directly to the WordPress or PHP service.

This boundary belongs in the proxy and WordPress runtime configuration, not in the plugin. The plugin relies on WordPress' resulting HTTPS decision.

If no secure path is recognized, the local Scouting login option may still be visible, but activating it fails safely before redirecting to the provider. The normal WordPress username/password form remains available as an administrator recovery path.

Clone this wiki locally