Expand my Community achievements bar.

Join us in celebrating the outstanding achievement of our AEM Community Member of the Year!

Unable to CURL to production env.

Avatar

Level 1

I am working on migrating assets from AEM 6.5 env to AEM cloud. When I try to make a curl to production instance I get 401.

The process which I follow is :
1. use technical account to generate JWT token.
2. Use the JWT token and add it to Curl as Bearer token and upload the data using /asset api microservice.

When I follow the above process in lower env (Dev env), I am able to upload assets successfully but same process is not working on Production and I am getting 401.

I have also added the my technical account's user in administrator group and also able to generate the JWT token successfully.

Is there anything that I have missed which could be causing this issue?


Topics

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

3 Replies

Avatar

Level 2

Hi @AshishSh5,

 

According to Adobe’s documentation, here are the guidelines to be followed when implementing server-to-server API integration:

  • Fetch the credentials on AEM as a Cloud Service from the Developer Console
  • Install the credentials for AEM as a Cloud Service on a non-AEM server making calls to AEM
  • Generate a JWT token and exchange that token for an access token using Adobe’s IMS APIs
  • Calling the AEM API with the access token as a Bearer Authentication token
  • Set appropriate permissions for the technical account user in the AEM environment

From your description, I believe you might have missed out exchanging the JWT token for an access token using Adobe's IMS API.

 

Below are some documentation links with further details: 

Hope this helps,

Vinay

Avatar

Employee

Hi @AshishSh5 ,

 

Can you share the CURL command and error message?

 

Regards

Avatar

Community Advisor

@AshishSh5 

 

Please verify if the user is synced to the AEM Production Environment or not. 

 

If, for any reason, the technical account user is not yet present in AEM, you can create the account by sending an HTTP request with a valid token to AEM. This can be accomplished through tools like the curl command or Postman. You might not be able to access any resource, as group association is pending. But, a user corresponding to service account will be created.

Once user is created, check its group association in AEM


Aanchal Sikka