Install the following NuGet package in your solution using the NuGet Package Manager in Visual Studio or using the command line:
dotnet add package EPiServer.OptimizelyIdentity
startup.cs in the
ConfigureServices method, enable Opti ID with following:
Opti ID is only enabled in shell modules, preview, and edit mode by default.
UseAsDefault enables Opti ID globally throughout the application. You can configure
AuthenticationOptions when more control is needed over which authentication scheme is active. The namespace
EPiServer.OptimizelyIdentity.OptimizelyIdentityDefaults contains constants if you must reference the scheme name while configuring.
Remove any calls to
services.AddCmsAspNetIdentity<TUser>() if ASP.NET Identity is not being used.
Edit and admin mode is accessible on
Run Opti ID locally
You can use Opti ID locally on
https://localhost:5000. For this to work, you also need the settings below, which you can find in Developer Portal > API > Opti ID dev key. These settings are provided automatically when the application is deployed to Optimizely Digital Experience Platform (DXP).
appsettings.json, add the following to run Opti ID locally:
Configure single sign-on with Microsoft Entra ID
(Optional) Read and complete the steps in each article to properly integrate Opti ID with Microsoft Entra ID:
- Configure single sign-on (SSO) in your Opti ID organization
- Configure your Domain Name System (DNS) domains in the Opti ID organization
- Configure group sync between Microsoft Entra ID and Opti ID
- Set up groups, roles, and users in Opti ID Admin Center
As per the group sync setup, you must establish a groups claim with precisely the list of groups you have defined in Entra ID and Opti ID. The group's name in Entra ID and Opti ID must match so that group membership is properly synced.
Ensure that in Entra ID, the groups are assigned to the registered Optimizely Content Management System (CMS) application. In Opti ID, the groups must define the product entitlements and the CMS roles for those users belonging to the group.
After all is properly set up, when a user logging in through Opti ID switches to the CMS product instance, the CMS reads the roles assigned to the user in any Opti ID group containing that user and the CMS product instance, and enables CMS features accordingly.