Can’t connect to Brand Portal with “JWT has expired” error | AEM

After configuring the Adobe Experience Manager (AEM) Assets integration with Brand Portal, if you encounter the error message JWT has expired, you should either change the Operating System time to a valid time or use the Network Time Protocol (NTP).

Description description

Environment

  • Adobe Experience Manager

  • Adobe Experience Manager Assets

Issue/Symptoms

After configuration of AEM Assets integration with Brand Portal, here in Overview of Experience Manager Assets Brand Portal: Configure Experience Manager Assets with Brand Portal in AEM Documentation,

Test Connection on the replication agent returns the error messages similar to these:

28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : Using user mac-mybptenant-replication for building content.
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : Creating content for path /content
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : Create new HttpClient for mybptenant MP Replication Agent Default
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : * HTTP Version: 1.1
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : * Using OAuth 2.0 Authorization Grants
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : * OAuth 2.0 User: mac-mybptenant-replication
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : Failed to get an access token for user: mac-mybptenant-replication msg: failed to get access token from authorization server status: 400 response: {"error":"invalid_grant","error_description":"JWT has expired"}
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : Sending POST request to https://mybptenant.brand-portal.adobe.com/bin/receive?sling:authRequestLogin=1
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : sent. Response: 401 Unauthorized
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : Replication (TEST) of /content not successful. Conversation follows
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : ------------------------------------------------
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : Sending message to mybptenant.brand-portal.adobe.com:-1
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : >> POST /bin/receive HTTP/1.0
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : >> Action: Test
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : >> Path: /content
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : >> Handle: /content
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : >> Referer: about:blank
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : >> Content-Length: 0
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : >> Content-Type: application/octet-stream
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : --
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << HTTP/1.1 401 Unauthorized
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << Date: Fri, 03 Mar 2017 04:29:05 GMT
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << Server: Apache/2.4.10 (Unix) Communique/4.2.1
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << WWW-Authenticate: Basic realm="Sling (Development)"
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << X-Frame-Options: SAMEORIGIN
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << X-XSS-Protection: 1; mode=block; report=https://service.brand-portal.adobe.com/security-bugs/log/mac
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << Content-Security-Policy: default-src 'self' https://*.adobe.com https://*.assetsadobe.com http://*.assetsadobe.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.brand-portal.adobe.com https://brand-portal.adobe.com https://*.marketing.adobe.com https://marketing.adobe.com https://use.typekit.net https://*.tt.omtrdc.net https://*.services.adobe.com https://*.adobelogin.com https://*.adobemc.com https://*.scene7.com https://assets.adobedtm.com https://*.guided.ss-omtrdc.net https://*.omniture.com https://*.demandbase.com; style-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.brand-portal.adobe.com https://brand-portal.adobe.com https://*.marketing.adobe.com https://marketing.adobe.com https://use.typekit.net https://*.tt.omtrdc.net https://*.guided.ss-omtrdc.net https://*.omniture.com https://*.scene7.com; img-src * data: ; font-src * data: ; frame-src 'self' https://*.brand-portal.adobe.com https://*.marketing.adobe.com https://*.omniture.com https://*.services.adobe.com https://services.adobe.com https://*.adobelogin.com; object-src 'self' https://*.scene7.com http://*.assetsadobe.com https://*.assetsadobe.com; report-uri https://service.brand-portal.adobe.com/security-bugs/log/mac
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << Timing-Allow-Origin: https://*.brand-portal.adobe.com/
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << Set-Cookie: renderid=rend2; path=/;Secure
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << Vary: User-Agent,Accept-Encoding
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : << Content-Length: 0
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : <<
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : Message sent.
28.02.2017 18:39:51 - ERROR - mp_replication_agent_default_mybptenant : ------------------------------------------------
28.02.2017 18:39:51 - INFO - mp_replication_agent_default_mybptenant : Replication (TEST) of /content not successful.

Specified Messages

Failed to get an access token
JWT has expired

Resolution resolution

Cause:
The cause is the time difference between the AEM instance and the Brand Portal cloud.

The difference causes the expiration of the JWT (JSON Web Token).

Solution:
Follow these steps:

  1. Confirm the Operating System time of AEM.
  2. Change the time to a valid time or use Network Time Protocol (NTP).
recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f