Skip to main content
This document explains the detailed usage of a specific policy. If you are using Apinizer policies for the first time or want to learn the general working principles of policies, we recommend reading the What is Policy? page first.

Overview

What is its Purpose?

  • Standardize end-user authentication by routing API Proxy traffic to external OIDC providers.
  • Lighten authentication load of microservices and centralize security with ID token and access token verification.
  • Sustain long-term user sessions securely thanks to session, cookie, and cache management.
  • Apply fine-grained authorization rules at API layer with role mapping and header injections.

Working Principle

  1. Request Arrival: For each HTTP/HTTPS request arriving at the API Gateway, the source IP address of the request is identified.
  2. Policy Check: If the OIDC Authentication policy is active, the system checks in the following order:
    • Is a Condition defined? If so, is the condition met?
    • Is the policy active (active=true)?
    • Is a Variable being used or is Apinizer default?
  3. OIDC Authorization Flow: Request is routed according to selected OIDC/OAuth2 flow type; issuer/discovery metadata is fetched, PKCE and nonce/state values are generated, token is validated.
  4. Decision Making:
    • Match Found: User information is extracted from verified token, header/cookie is updated, optional authorization service is triggered, and request is allowed.
    • No Match: Authorization fails, defined error message or redirect rule is applied.
  5. Error Handling: Customizable HTTP status code and error message are returned for requests that do not comply with the policy rule.

Features and Capabilities

Basic Features

  • Dynamic OIDC Discovery: Reduces manual configuration need by automatically discovering issuer, JWKS, and other metadata information through well-known endpoint.
  • Multiple Flow Support: Manages Authorization Code, Implicit, Hybrid, and pure OAuth2 Authorization Code flows in the same policy; increases security with PKCE support.
  • Token Verification Controls: Provides ID/Access token verification, signature algorithm control, user information retrieval, and API-based token verification options.
  • Active/Passive Status Control: Easily change the active or passive status of the policy (active/passive toggle). In passive mode, the policy is not applied but its configuration is preserved.
  • Condition-Based Application: Determine when the policy will be applied by creating complex conditions with Query Builder (e.g., only for specific endpoints or header values).

Advanced Features

  • Advanced Session Management: Meets corporate security standards with session cookie name, timeout, state/nonce verification, session encryption, and compression settings.
  • Role and Authorization Integration: Provides in-depth access management with role mapping, adding role to header, external authorization service, or Credential Role Service.
  • Adaptable Token Carrying: Can accept token via header, cookie, or both; can make bearer format mandatory, can use custom header names.
  • Export/Import Feature: Export policy configuration as a ZIP file. Import to different environments (Development, Test, Production). Version control and backup capability.
  • Policy Group and Proxy Group Support: Manage multiple policies within Policy Group. Bulk policy assignment to Proxy Groups. Centralized update and deploy operations.
  • Deploy and Versioning: Deploy policy changes to live environment. See which API Proxies use it (Policy Usage). Proxy Group and Policy Group usage reports.

Usage Scenarios

ScenarioStatusSolution (Policy Application)Expected Behavior / Result
Corporate Portal SSOSingle sign-on is desiredAuthorization Code + PKCE, global policyUser is authorized in all API Proxies with single login.
Mobile App SecurityToken leakage risk exists in mobile clientsPKCE enabled, short token cache durationMobile app stores token in secure storage, renews when expired.
Legacy API ProtectionOld services use Basic AuthenticationToken validation + header injectionAuthentication is done at gateway, service only reads header.
External Business Partner IntegrationExternal systems want cookie-based accessToken is written to cookies, SameSite/secure is setBusiness partner browsers carry session without additional config.
Multiple OIDC Provider ManagementDifferent tenants use different issuersCustom condition + discovery URL variableEach tenant request is routed to its own issuer and verified.
High-Security APIToken signature and aud verification mandatoryValidateJwtSignature + ExpectedAudience listTokens containing wrong issuer/audience are rejected with 403.
Developer Sandbox (optional)Light verification needed in test environmentCondition with /sandbox/* path selection, debug logging openOnly sandbox calls pass weak verification, live traffic is not affected.

Configuring Policy Parameters

In this step, users can create a new policy or configure existing policy parameters to define access rules. The defined parameters directly affect how the policy works (e.g., which IPs will be allowed, geographical restrictions, conditional activations, etc.). This allows the policy to be customized according to organization-specific requirements while being centrally manageable.

Creating a New OIDC Authentication Policy

The sections below walk through the OIDC (Keycloak, Okta, Azure AD, …) configuration profile in tab order, with screenshots and field tables for that profile. For how OAuth2 (External OAuth2 Provider) differs, finish these OIDC sections first, then read OIDC vs OAuth2 configuration profile — UI differences right after them (including OAuth2 Parameters and Session & HTML screenshots).

Connection tab

OIDC Connection: provider, endpoints, and client OIDC Connection: flow and additional authorization parameters Configuration Profile: OIDC (Keycloak, Okta, Azure AD, …) or OAuth2 (External OAuth2 Provider) — determines flow type, visible tabs, and fields; many fields remain editable after selection.
SectionFieldNotes
Provider ConfigurationOIDC Issuer URL (required)e.g. https://accounts.google.com. Use Auto Discover for metadata.
Discovery URLIf empty, derived from issuer; or set explicitly (e.g. …/.well-known/openid-configuration).
Endpoint ConfigurationAuthorization Endpoint (required)Authorization endpoint URL.
Token Endpoint (required)Token endpoint URL.
UserInfo EndpointUserInfo URL. OIDC profile only.
JWKS EndpointJWKS URL for signature verification. OIDC profile only.
Introspection EndpointToken introspection URL. OIDC profile only.
Token Revocation EndpointRevocation URL. OIDC profile only.
oauth2ResourceEndpoint (required)OAuth2 profile only; replaces the four endpoints above.
Client InformationClient ID (required)OAuth/OIDC client identifier.
Client SecretClient secret (show/hide).
Redirect URI (required)OAuth redirect URI.
RealmProvider-specific realm when applicable. Hidden in OAuth2 profile.
Flow ConfigurationFlow Type (required)OIDC: choose from list. OAuth2: OAUTH2_AUTHORIZATION_CODE is fixed in the backend; OAuth2 Username Extraction Path appears on this profile.
Authentication Modee.g. External OIDC Provider Only.
Enable PKCEProof Key for Code Exchange on/off.
ScopesComma-separated scopes, e.g. openid, profile, email.
Additional Auth ParametersTable: Header Name / Header ValueExtra authorization request parameters (acr_values, login_hint, prompt, etc.). OIDC profile only; use OAuth2 Parameters tab for OAuth2.

Token & Validation tab

OIDC configuration profile only. The OAuth2 profile uses the OAuth2 Parameters tab instead of this one. Defines how incoming tokens are validated, forwarded to backends, and cached (JWT checks, UserInfo, header/cookie behavior). OIDC Token & Validation tab Token Validation
FieldDescription
Bearer JWT AuthenticationAuthenticate using Bearer JWT.
Validate ID TokenValidate the ID token.
Validate Access TokenValidate the access token.
Validate Token with APIValidate the token via API.
Call Userinfo EndpointCall UserInfo; extra user data may be forwarded to the backend as a header.
Token Cache Timeout (sec)Token cache TTL (seconds).
JWK Cache Timeout (sec)JWKS cache TTL (seconds).
Token Accept Settings
FieldDescription
Accept Token Ase.g. Header and Cookie — where the token is accepted from.
Add Token to CookieWrite token to cookie.
Add as BearerUse Bearer format.
Add Access Token to HeaderForward access token in a header.
Access Token Header Namee.g. Authorization.
Add ID Token to HeaderForward ID token in a header.
ID Token Header Namee.g. IdToken.
Disable UserInfo HeaderDo not add UserInfo payload as a header.
UserInfo Header Namee.g. UserInfo.
JWT Validation Details
FieldDescription
Validate IssuerValidate iss; when on, set Expected Issuer if needed.
Validate AudienceValidate aud.
Validate JWT LocallyLocal JWT validation.
Validate JWT SignatureSignature verification.
Cache Settings (duplicate block in UI)
FieldDescription
Token Cache Timeout (sec)Token cache duration.
JWK Cache Timeout (sec)JWK cache duration.

Session & Logout tab

OIDC configuration profile only (full session and logout). The OAuth2 profile uses Session & HTML instead (simplified session + HTML templates). Session cookie, token cookies, and logout behavior. OIDC Session & Logout tab Session Settings
FieldDescription
Session Cookie NameSession cookie name (e.g. OIDC_SESSION).
Session Timeout (min)Session idle timeout (minutes).
Absolute Timeout (sec)Absolute session lifetime (seconds).
Secure CookieSend cookie only over HTTPS.
Enable State ValidationValidate OAuth state.
Enable Nonce ValidationValidate OpenID nonce.
Token Cookie Settings
FieldDescription
Renew Access Token on ExpiryRefresh access token when it expires.
Access Token Cookie NameCookie name for access token.
Enable ID Token CookieStore ID token in cookie.
ID Token Cookie NameID token cookie name.
Enable Refresh Token CookieStore refresh token in cookie.
Refresh Token Cookie NameRefresh token cookie name.
Logout Settings
FieldDescription
Logout PathLogout URL path (e.g. /logout).
Post Logout Redirect URIRedirect after logout at provider.
Redirect After Logout URIRedirect after logout in Apinizer.
ID Token Hint in LogoutSend id_token_hint on logout.
Revoke Tokens on LogoutRevoke tokens when logging out.
Token Revocation EndpointRevocation endpoint URL.

User Mapping tab

OIDC configuration profile only. There is no User Mapping tab on the OAuth2 profile; use OAuth2 Username Extraction Path on Connection and the OAuth2 Parameters tab. Maps OIDC claims to user fields, roles, and backend headers. OIDC User Mapping tab Claim Paths
FieldDescription
Username Claim PathClaim for username (e.g. sub).
Email Claim PathClaim for email (e.g. email).
Display Name Claim PathClaim for display name (e.g. name).
Role Mappings (table)
ColumnDescription
Claim PathClaim to match.
Claim ValueExpected value.
Target RoleRole to assign.
Custom Claim Mappings (table: Header Name / Header Value) Backend Header Settings
FieldDescription
Disable UserInfo HeaderDo not forward UserInfo as a backend header.
UserInfo Header NameHeader name for UserInfo (e.g. UserInfo).
Custom HTTP Headers (table: Header Name / Header Value) — additional headers sent to the backend.

Security & Other tab

TLS/mTLS to the provider, timeouts, request filtering, error redirects, and debug options. OIDC Security & Other tab Secure Connection Settings
FieldDescription
Enable Secure Connection SettingsEnable TLS/mTLS and certificate options.
Skip SSL VerificationSkip server certificate verification (use only for testing).
TrustStore (JKS/PKCS12)Trust store (accordion).
Certificate (PEM)PEM certificate (accordion).
KeyStore (Client Certificate)Client certificate / mTLS (accordion).
Protocol & Verification SettingsProtocol and verification (accordion).
These settings affect all connections to the OIDC provider; incorrect mTLS configuration can cause connection failures. IP and Security Control
FieldDescription
Check Client IPValidate client IP. OIDC configuration profile only.
Timeout Settings
FieldDescription
Connection Timeout (sec)Connect timeout.
Read Timeout (sec)Read timeout.
Max Clock Skew (sec)Clock skew tolerance for JWT iat/exp, etc.
Request Filtering
FieldDescription
Ignored MethodsHTTP methods skipped by the policy (e.g. OPTIONS). OIDC configuration profile only.
Ignored PatternsComma-separated path/file patterns (e.g. static/js, *.css, *.png). OIDC configuration profile only.
Error Handling
FieldDescription
Error Redirect URLRedirect URL on error.
Include Error DetailsInclude error details in the response.
Error Message TemplateCustom error message template.
Debug and Logging
FieldDescription
Debug LoggingVerbose logging.
User AgentUser-Agent for OIDC requests (e.g. Apinizer-OIDC-Client/1.0).
Other
FieldDescription
Clear AuthorizationRemove existing authentication information from the message.
Add User to HeaderOn success, add username or clientId to a header.
User Header NameName of that header (help text may suggest e.g. X-Authenticated-UserId; UI may show e.g. User).

OIDC vs OAuth2 configuration profile — UI differences

The tables above document the OIDC profile tabs in order. When Configuration Profile is set to OAuth2 (External OAuth2 Provider), Manager shows or hides different tabs and conditional fields on the same policy screen; this section summarizes that behavior. In Apinizer Manager, the Configuration Profile radio buttons (OIDC / OAuth2) control this.

Summary table

OIDC (Keycloak, Okta, Azure AD, …)OAuth2 (External OAuth2 Provider)
flowType in the backgroundSelected from dropdown: Authorization Code, Implicit, Hybrid (pure OAuth2 Authorization Code is not listed)Fixed: OAUTH2_AUTHORIZATION_CODE — set in code when the profile changes
Connection — endpointsUserInfo, JWKS, Introspection, Revocation fields are shownThose four are hidden; instead the required oauth2ResourceEndpoint field is shown
RealmShownHidden
Extra authorization parametersAdditional Auth Params panel (OIDC)No panel here; instead OAuth2 Auth / Token / Resource parameter tables on a separate tab
Flow panelNo Username Extraction Path (OAuth2-specific)OAuth2 Username Extraction Path is shown
Tab orderConnection → Token & ValidationSession & Logout (full) → User Mapping → Security & OtherConnection → OAuth2 ParametersSession & HTML → Security & Other
Both profiles typically also include: Conditions, Error Message Customization, API Proxies Using Policy, API Proxy Groups Using Policy (logic is largely independent of profile).

Hidden or different when OAuth2 profile is selected (vs OIDC)

  • Token & Validation tab: Bearer JWT, ID/access token checks, UserInfo, JWT issuer/audience/signature, token accept settings, etc.
  • Full Session & Logout tab (OIDC): state/nonce, absolute timeout, token cookie names, logout path, revoke, post-logout, etc.
  • User Mapping tab: claim paths, role mappings, custom claim mappings.
  • On Security & Other, Check Client IP and Ignored Methods / PatternsOIDC profile only.

Additional / different on OAuth2 profile

The following tabs and screenshots appear only when OAuth2 (External OAuth2 Provider) is selected. Tables use Header Name / Header Value pairs or template editors as appropriate.
OAuth2 Parameters tab
OAuth2 Parameters tab: Authorization, Token, Resource, and Backend Request Headers
SectionDescription
Authorization ParametersExtra HTTP headers for the authorization request (oauth2AuthParams). Table: Header Name / Header Value; use + to add rows.
Token ParametersExtra headers for the token exchange request (oauth2TokenParams).
Resource ParametersExtra headers when calling the resource / user-info request (oauth2ResourceParams).
Backend Request HeadersExtra headers sent to the backend after successful authentication (collapsible section; + to add rows).
Session & HTML tab
Session & HTML tab: session settings and HTML response pages Replaces the full OIDC Session & Logout and User Mapping tabs for this profile: simplified session fields and optional HTML Response Pages for login, error, and success. Session Settings
FieldDescription
Session Cookie NameSession cookie name (e.g. OIDC_SESSION).
Session Timeout (min)Session lifetime in minutes.
Secure CookieSend cookie only over HTTPS.
Renew Access Token on ExpiryAttempt to refresh the access token when it expires.
HTML Response Pages (when enabled)
FieldDescription
HTML Response PagesEnables custom HTML pages (similar to enableHtmlResponsePages).
Application TitleTitle shown on pages (may be referenced in templates, e.g. {{APP_TITLE}}).
Success Page CallRedirect after successful authentication.
Success Page URLTarget URL after success.
Login / Error / Success Page TemplateThree sub-tabs for HTML templates for login, error, and success flows.

Common to both profiles

  • Connection is largely shared: Issuer, Discovery URL, Authorization Endpoint, Token Endpoint, Client ID, Client Secret, Redirect URI, PKCE, Scopes, Authentication Mode (endpoint and flow fields differ per summary table above).
  • Security & Other: mTLS/SSL, connection/read timeout, max clock skew, error redirect, debug, user headers; Conditions and Error Message Customization remain profile-independent in behavior.
If documentation states a single tab order for both profiles, that does not fully match the Manager UI: with OAuth2 selected, OAuth2 Parameters and Session & HTML replace Token & Validation, full Session & Logout, and User Mapping. Note: UI behavior depends on profile flags such as isOIDCProfile / isOAuth2Profile; fields may change between Apinizer versions.

Configuration Steps

OIDC profile recommended order: ConnectionToken & ValidationSession & LogoutUser MappingSecurity & Other → optional Conditions, Error Message Customization, API usage tabs. OAuth2 profile order differs: ConnectionOAuth2 ParametersSession & HTMLSecurity & Other → same optional tabs. This page first documents OIDC tabs in tables; OAuth2 differences are in the OIDC vs OAuth2 configuration profile — UI differences section immediately above. The steps below follow the OIDC flow first; if you use OAuth2, fill Connection using the summary table in that section, then use OAuth2 Parameters and Session & HTML instead of Steps 5–6 as written for OIDC.
StepDescription / Operation
Step 1: Go to Creation Page- Go to Development → Global Settings → Global Policies → OIDC Authentication Policy from the left menu.
- Click the [+ Create] button at the top right.
Step 2: Enter Basic InformationPolicy Status: Shows Active/Passive status. New policies are active by default.

Name (Required): Example: Production_OIDCAuth
- Enter a unique name, does not start with space.
- System automatically checks. Green checkmark: available. Red X: existing name.

Description: Example: “OIDC SSO for corporate users”
- Max. 1000 characters.
- Explain the purpose of the policy.
Step 3: Variable Usage- In the action button area at the top of the page, you can use the [<> Variable] button to select dynamic values.
- Using context/global variable expressions, you can manage policy parameters with variable-based values instead of fixed values.
- This reduces manual update effort when values change and provides operational convenience.
- For detailed information, review Dynamic Variables.
Step 4: Connection — provider, endpoints, client, flow- Choose Configuration Profile (OIDC or OAuth2).
- Enter OIDC Issuer URL; use Auto Discover or Discovery URL as needed.
- OIDC: After discovery or manual entry, verify Authorization, Token, UserInfo, JWKS, Introspection, and Token Revocation; use Realm and Additional Auth Parameters on this profile.
- OAuth2: UserInfo / JWKS / Introspection / Revocation are not shown; fill required oauth2ResourceEndpoint; Realm and the Connection Additional Auth Parameters panel are absent (use OAuth2 Parameters tab). Flow is fixed to OAUTH2_AUTHORIZATION_CODE in the backend; set OAuth2 Username Extraction Path when needed.
- Client ID, Client Secret, Redirect URI are shared. Redirect URI must exactly match the provider-registered URL.
- Set Enable PKCE, Scopes, Authentication Mode, etc.
Step 5: Token & session tabs or OAuth2 tabs → Security & OtherOIDC profile: In order: (1) Token & Validation, (2) Session & Logout, (3) Security & Other — matches tables above. Token validation, UserInfo, cache; session/logout; no skip-SSL in production; on OIDC, Check Client IP, Ignored Methods / Ignored Patterns live here. Do not confuse Error Redirect URL with Step 8 JSON body; enable Debug Logging only briefly.

OAuth2 profile: No Token & Validation or full Session & Logout. Use OAuth2 Parameters (oauth2AuthParams, oauth2TokenParams, oauth2ResourceParams, Backend Request Headers) and Session & HTML (simplified session + HTML login/error/success); then Security & Other (shared TLS, timeouts, error redirect, debug, user headers — Check Client IP and ignore fields are not shown on OAuth2).
Step 6: User Mapping (OIDC) or backend headersOIDC profile: Claim Paths, Role Mappings, Custom Claim Mappings, Backend Header Settings, Custom HTTP Headers — keep consistent with Token & Validation UserInfo/header behavior.

OAuth2 profile: Use Backend Request Headers under OAuth2 Parameters and username extraction on Connection instead; there is no classic User Mapping tab.
Step 7: Define Condition (Optional)- Go to Condition tab.
- Conditions determine when the policy will be active.

Examples:
- Environment-based: Header = X-Environment, Operator = Equals, Value = production
- API Key-based: Header = X-API-Key, Starts With = PROD-
- Endpoint-based: Path = /api/admin/*

If no condition is defined, policy is always active
Step 8: Customize Error Message (Optional)- Go to Error Message Customization tab.
- Customize the JSON API response body when access is denied. This differs from Error Redirect URL on Security & Other (browser redirect); if you use both, test the combined behavior.

Default:
{ "statusCode": 403, "message": "[Default error message]" }

Custom:
{ "statusCode": 403, "errorCode": "[CUSTOM_ERROR_CODE]", "message": "[Custom message]" }
Step 9: Save- Click the [Save] button at the top right.

Checklist (summary):
- Unique Name and required Connection fields: OIDC Issuer URL; Authorization / Token; Client ID; Redirect URI; OIDC Flow Type, OAuth2 oauth2ResourceEndpoint.
- Redirect URI matches the provider registration.
- OIDC: Token & Validation / Session & Logout / User Mapping complete as needed; OAuth2: OAuth2 Parameters and Session & HTML complete.
- Optional Conditions / Error Message Customization tested.

Result: Policy is added to the list; can be connected to APIs; if global, applied automatically.
For descriptions of Conditions and Error Message Customization panels, you can review the Conditions and Error Message Customization sections on the What is Policy? page. For a complete guide on all layers, priority order and scenario examples of the error message configuration system, see the Error Message Configuration Guide page.

Deleting the Policy

For deletion steps of this policy and operations to be applied when in use, you can refer to the Remove Policy from Flow section on the Policy Management page.

Exporting/Importing the Policy

For export (Export) and import (Import) steps of this policy, you can refer to the Export/Import page.

Connecting the Policy to API

For the process of how this policy will be connected to APIs, you can refer to the Connect Policy to API section on the Policy Management page.

Advanced Features

FeatureDescription and Steps
Dynamic Metadata Discovery- Automatically fetches issuer, JWKS, endpoint information when Discovery URL is entered.
- Performance adjustment is made with metadata cache timeout.
- Policy returns error message if discovery fails.
Session Management- Session data is stored in distributed cache (mandatory).
- Session encryption key and IV are automatically generated from policy ID.
- Configure with session cookie name, timeout, absolute timeout, and cookie delimiter.
mTLS Configuration- mTLS can be used when connecting to OIDC provider.
- KeyStore/TrustStore-based SSL connection and skip SSL verification option are provided.
Token Cookie Configuration- Access token, ID token and refresh token cookie names can be customized.
- Which tokens are written to cookies can be determined.
Token Acceptance Path- Where token is read from (header, cookie, or both) can be determined.
Logout and Token Revocation- Tokens are revoked via revocation endpoint on logout.
- Redirect URL after logout can be defined.
Authentication Mode- EXTERNAL_ONLY (external OIDC), INTERNAL_ONLY (Bearer only), HYBRID (both).
- Both authentications can be enforced in Hybrid mode.
OAuth 2.0 HTML Pages- Custom login, error, and success pages are shown in OAuth 2.0 flow.
- Page templates can be customized.
- Post-authentication redirect can be configured.
Role Mapping and Header Injection- Claim path and target role matching is done.
- Roles can be added to header, header names can be customized.
- Role selection is done with Identity Role Group Service.

Best Practices

Things to Do and Best Practices

CategoryDescription / Recommendations
OIDC Provider ManagementBad: Using single issuer for all environments.
Good: Defining different issuers for test and live.
Best: Making environment-based issuer selection with Condition.
Token SecurityBad: Closing signature verification.
Good: Performing JWT signature verification.
Best: Caching JWKS keys and refreshing periodically.
Session DurationsBad: Leaving durations at default.
Good: Determining timeout according to user profile.
Best: Implementing Session absolute timeout + refresh token strategy.
Role ManagementBad: Using single claim for roles.
Good: Extracting role with claim path.
Best: Making centralized role mapping with Identity Role Group Service.
Error ManagementBad: Transmitting general error message.
Good: Specifying OIDC-specific error message.
Best: Providing different content that is user-friendly and log-friendly in Error Message Customization.

Security Best Practices

Security AreaDescription / Warnings
TLS MandatoryAll endpoint addresses must be HTTPS; allowInsecureConnections=true is recommended only for temporary use.
PKCE UsageenablePKCE=true should be configured for mobile and SPAs, code verifier should not be logged.
Nonce/State ProtectionNonce and state verification should not be disabled; mandatory against replay attacks.
Session SecuritySession data is stored in cache; encryption key is automatically generated from policy ID. TLS must be mandatory.
Cookie SecuritySecure, HttpOnly, and SameSite policies should be enabled; token cookies should be sent with minimum permissions.

Things to Avoid

CategoryDescription / Warnings
Default Key UsageWhy to avoid: Manual session key values may be predictable.
Alternative: Session encryption is automatically generated from policy ID; ensure policy ID is unique.
Wide Scope DefinitionsWhy to avoid: Excessive scope causes privilege escalation.
Alternative: Add only necessary scopes with least privilege principle.
Long Cache DurationsWhy to avoid: If JWKS/token cache is kept long, compliance with key rotation weakens.
Alternative: Select cache duration between 15-60 minutes and establish refresh mechanism.
Keeping Debug Logs Open in LiveWhy to avoid: Sensitive token information may fall into logs.
Alternative: Open debug logging only briefly during troubleshooting.

Performance Tips

CriterionRecommendation / Impact
Metadata CacheRecommendation: Keep providerMetadataCacheTimeoutSeconds value between 900-1800 seconds.
Impact: Discovery endpoint calls decrease, latency drops.
Token Cache TimeoutRecommendation: Adjust tokenCacheTimeoutSeconds according to OIDC access token lifetime.
Impact: Unnecessary re-verifications are prevented, back-end load decreases.
JWKS CacheRecommendation: Do not exceed 3600 seconds upper limit for jwkCacheTimeoutSeconds.
Impact: Acceptance of incorrect signatures during key rotation is prevented.
Ignore PatternsRecommendation: Add static content paths to ignore patterns field.
Impact: Static files are freed from unnecessary redirection, response time increases.
Backend Header ManagementRecommendation: Remove unnecessary backend header entries.
Impact: Request size and processing time going to backend decreases.

Frequently Asked Questions (FAQ)

CategoryQuestionAnswer
GeneralWhat is OIDC authentication?OpenID Connect (OIDC) is an authentication protocol built on OAuth 2.0. Verifies user identity using ID token and access token.
GeneralWhich flow types are supported?Authorization Code, Implicit, Hybrid, and pure OAuth2 Authorization Code flow types are supported.
TechnicalHow is token verified?Gateway receives token, verifies JWT signature with public key obtained from JWKS endpoint, performs audience and issuer check.
TechnicalWhat is PKCE?Proof Key for Code Exchange (PKCE) is a security mechanism providing protection against authorization code interception attacks.
UsageHow are different OIDC providers used for different tenants?Tenant-based issuer selection can be done with Condition or discovery URL variable can be used.
UsageHow can I change default error message?You can edit status code, error code, and message fields from Error Message Customization tab.
GeneralCan OIDC policy work together with Basic Authentication policy?Yes, but Basic Authentication is recommended only as fallback; you can determine which policy will work conditionally.
GeneralDoes global copy get affected when I convert policy to local?No, Localize operation creates a new local policy; global policy remains unchanged.
TechnicalWhich fields should I fill if I don’t use Discovery URL?You need to manually enter Authorization, Token, UserInfo, JWKS, and Introspection endpoint addresses.
TechnicalWhich log messages should I look for when token verification fails?You can examine error details of validateAccessTokenWithApi and validateJwtSignature steps by opening Policy debug logs.
UsageHow do I share same policy for multiple API Proxies?You can create policy globally and assign to relevant API Proxies or use Policy Group.
UsageIs PKCE mandatory for mobile applications?Recommended for strong security; activate enablePKCE=true setting to prevent code interception attacks.
TechnicalWhat does authentication mode (EXTERNAL_ONLY, INTERNAL_ONLY, HYBRID) mean?EXTERNAL_ONLY: OIDC redirect only. INTERNAL_ONLY: Bearer token only (header/cookie). HYBRID: Both; both can be enforced in Hybrid mode.
TechnicalHow is token revocation done on logout?Enable token revocation on logout option and define revocation endpoint. If not set, it is derived from introspection endpoint (/introspect → /revoke).