Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Possibility to reuse acscommons.io.jsonwebtoken

Avatar

Level 2

Hi Folks,

I am building a servlet that needs to call another AEM instance with JWT.

I am not allowed to integrate jjwt as a 3rd party lib.

I found that Jwt is exist in acs-aem-commons-bundle-5.0.6.jar:

HenryLiang_0-1709668156650.png

I can import the Jwts through:

import acscommons.io.jsonwebtoken.Jwts;
import acscommons.io.jsonwebtoken.SignatureAlgorithm;

My local maven build succeeds with the following the following pom:

core:

<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-bundle</artifactId>
</dependency>

parent:

<dependency>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons-bundle</artifactId>
<version>5.0.6</version>
<scope>provided</scope>
</dependency>

 

However, when committing the code and building with AEMaaCS pipeline, the following error shows:

[api-regions-exportsimports] com.xxx:aem-xxx-project.core:2024.305.1190454.0003824093: Bundle aem-xxx-project.core:2024.305.1190454.0003824093 is importing package(s) acscommons.io.jsonwebtoken in start level 20 but no bundle is exporting these for that start level. (com.xxx:aem-xxx-project.all:2024.305.1190454.0003824093)
[api-regions-exportsimports] com.xxx:aem-xxx-project.core:2024.305.1190454.0003824093: Bundle aem-xxx-project.core:2024.305.1190454.0003824093 is importing package(s) acscommons.io.jsonwebtoken in start level 20 but no bundle is exporting these for that start level. (com.xxx:aem-xxx-project.all:2024.305.1190454.0003824093)
[api-regions-exportsimports] com.xxx:aem-xxx-project.core:2024.305.1190454.0003824093: Bundle aem-xxx-project.core:2024.305.1190454.0003824093 is importing package(s) acscommons.io.jsonwebtoken in start level 20 but no bundle is exporting these for that start level. (com.xxx:aem-xxx-project.all:2024.305.1190454.0003824093)

May I know if I can use acscommons.io in this way?

If so, what am I missing?

If not, is there any way to create JWT token with plain Java?

 

Thanks!!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
1 Reply

Avatar

Correct answer by
Community Advisor