Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

CMS + CMP publishing integration issue: Failed to get access token

Vote:
 

Hi folks,

 

I followed this documentation to integrate our DXP-hosted CMS website into Content Marketing Platform. However when I select an existing page from the CMS channel, this error shows up:

Not sure what's wrong with my integration settings, but the CMS Content Tree actually loaded successfully when I hit "Add Content" button. It just broke after I chose a page and selected "Add To Task".

This is my current CMP configuration (I did also add UseCmsCmpPublishingPreviewLinks under Startup as well):

        services.AddCmsCmpPublishing();

        // Allow the quick editor to be embedded into CMP via an iframe
        services.Configure<CookieAuthenticationOptions>(OptimizelyIdentityDefaults.CookieSchemeName, options =>
        {
            options.Cookie.SameSite = SameSiteMode.None;
            options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
        });
        if (webHostingEnvironment.IsDevelopment())
        {
            // This automatically configures dev signing credentials to call Integration API
            services.Configure<CmsServiceOptions>(o =>
            {
                o.AddDevelopmentSigningCredentials();
            });
        }

Have anybody experienced this issue before?

 

Thank you,
Tung

#337702
Apr 03, 2025 9:53
Vote:
 

Hi Tung, have you added the CMP ClientId and ClientSecret in your appSettings.json ?

This will be used by the CMS to get the auth token to access the CMP API

#337708
Apr 04, 2025 0:59
Vote:
 

Hi Ronil,

 

Thanks for your reply. Yes I already created an app in my CMP and added these settings under the appSettings.json. The exception happens in this particular API: https://cmp.optimizely.com/api/v3/tasks/67e6ad7505f9f8d461c8e9d4/structured-content/cms


This might be an internal API from CMP because I couldn't find it in the  CMP Open API documentation

#337710
Apr 04, 2025 4:19
Vote:
 

Assume you have also setup the OauthClient in CMS and CMP?

#337712
Apr 04, 2025 6:01
Vote:
 

Yes I did. I grant the access right to the clientid "cmp_publishing_integration" as well. I only skiped the multi CMP instances configuration part because I only work with one instance of CMP.
In fact, I can pull the content tree from the CMS, the problem only occurs when I hit "Add To Task" button to return to the Task screen

#337714
Apr 04, 2025 6:24
Vote:
 

Today I used Ngrok to connect CMP to my local environment. Interestingly I found a message from the CMS at the same time as the error appears in CMP:

2025-04-04 16:02:58.541 +07:00 [INF] opti-fallback-scheme was not authenticated. Failure message: Authentication failed.

#337719
Apr 04, 2025 14:33
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.