Skip to main content

Outline

At a glance
  • Standardized Identity: CMS 13 replaces legacy SQL-based auth with native OIDC and OAuth 2.0 via Opti ID.
  • Architectural Roles: Understanding the relationship between the Identity Provider (IdP) and the Relying Party (RP) is critical for configuration.
  • Secure Handshake: Authentication follows the Authorization Code Flow with PKCE, ensuring tokens are exchanged securely server-to-server.
  • Claims-Based Logic: Permissions are managed through JWT claims and transformation logic rather than local user tables.

The modern digital ecosystem has transitioned away from siloed, password-based authentication models toward standardized, interoperable identity protocols. For developers working with Optimizely CMS 13 (PaaS), understanding these protocols is no longer an optional "IT task"—it is a core architectural requirement. CMS 13 utilizes Opti ID, an identity platform built natively on OpenID Connect (OIDC) and OAuth 2.0. This article provides a comprehensive deep-dive into the OIDC concepts every CMS developer must master to build secure, cross-product workflows and manage complex authorization schemas.

The Foundation: From Passwords to Protocols

In the early days of CMS development, user identities were often stored in local SQL tables (like ASP.NET Identity or Membership Providers). While simple, this meant that moving between a CMS and a separate Digital Asset Manager (DAM) required a second login, leading to "password fatigue" and security vulnerabilities.

Single Sign-On (SSO) solves this by allowing a user to authenticate once with a trusted authority and gain access to multiple independent systems. To achieve this across different platforms, the industry settled on OpenID Connect (OIDC) as the dominant standard. OIDC is an identity layer built on top of the OAuth 2.0 framework, allowing clients to verify the identity of an end-user based on the authentication performed by an Identity Provider (IdP).

Core Definitions for the CMS Developer

To navigate the configuration files and logs of a CMS 13 instance, a developer must first internalize several key roles in the OIDC relationship:

  • The Identity Provider (IdP): The authority that maintains user records and validates credentials. In CMS 13, Opti ID is your primary IdP. However, Opti ID can itself be a "federated" proxy, delegating the actual password-check to an enterprise provider like Microsoft Entra ID (Azure AD) or Okta.
  • The Relying Party (RP) / Client: The application that "relies" on the IdP to verify user identities. When you are configuring your Optimizely CMS instance, the CMS codebase acts as the RP. It treats the IdP as the source of truth for identities and roles.
  • The Backend-for-Frontend (BFF): In headless scenarios, your frontend application might be its own RP, or it might rely on the CMS to pass along authorization tokens to backend services like Optimizely Graph.

The Anatomy of the OIDC Handshake

Understanding the flow of data during a login event is essential for debugging "Login Loops" or "Unauthorized" errors. A typical interaction follows the Authorization Code Flow with PKCE:

  1. Challenge: A developer tries to access /episerver/cms. The CMS (the RP) sees no active session and redirects the browser to the Opti ID Login URL.
  2. Authentication: The user enters their credentials at Opti ID. If multifactor authentication (MFA) is required, it happens here.
  3. Authorization Code: Successfully authenticated, Opti ID redirects the browser back to the CMS’s "Callback URL" (e.g., /signin-oidc) with a temporary Authorization Code.
  4. Token Exchange: Behind the scenes (server-to-server), the CMS sends this code back to Opti ID along with a "Client Secret" to prove its own identity.
  5. Token Issuance: Opti ID validates the code and issues a set of tokens: an ID Token (who is the user?), an Access Token (what can they do?), and often a Refresh Token (how can I stay logged in?).

JWT and Claims: The Developer’s Passport

The most critical artifact generated by this handshake is the JSON Web Token (JWT). A JWT is a cryptographically signed snippet of JSON that acts as a secure container for user data. For a CMS developer, the "Payload" section of the JWT is where the most valuable data lives, stored as Claims.

Key Claims in Optimizely CMS 13

  • sub (Subject): A unique, immutable identifier for the user. Developers should use the sub claim rather than the email address when linking CMS history or preferences to a specific person.
  • email: The user's primary login email.
  • cg-roles: This is a specialized claim used by Optimizely Graph. It contains roles (e.g., cg-editor, cg-admin) that determine if the user can query draft content.
  • exp (Expiration): A timestamp indicating when the token becomes invalid.

Role Mapping: Connecting Identity to Permission

Authentication only proves who a user is. Authorization determines what they can do. In a CMS developer's world, this link is maintained through Role Mapping. Permissions within the CMS are still governed by traditional roles, but these should be mapped from groups defined within Opti ID or your federated IDP.

Developers often implement a Claims Transformation step during the OnTokenValidated event. This logic says: "If the user has the 'Marketing_Lead' claim from Okta, treat them as a 'WebEditor' in my CMS." This enables SCIM provisioning, where adding a user to an "Optimizely Group" in Azure AD automatically grants them the correct permissions in your CMS instance.

Security Governance and Best Practices

  • HTTPS Enforcement: OIDC protocols will fail if the connection is not encrypted. Tokens must never travel over plain HTTP.
  • Callback URL Whitelisting: Every RP must register its redirect URIs with Opti ID. Production and local development URIs must both be permitted in the Opti ID admin console.
  • Secret Rotation: "Client Secrets" are effectively passwords for your application. Store these in secure vaults like Azure Key Vault rather than plain-text appsettings.json files.

Conclusion

Understanding OIDC and SSO concepts is the key to unlocking the full power of Optimizely CMS 13 PaaS. By mastering the relationship between Identity Providers and Relying Parties, the structure of JWT claims, and the mechanics of the OIDC handshake, CMS developers can build platforms that are not only highly secure but also deeply integrated into the wider enterprise ecosystem.