Expand my Community achievements bar.

SOLVED

Basic Auth for AEM Assets

Avatar

Level 2

Hello,

I'm trying to build an integration that works with AEM Assets using Assets HTTP API. I am using this article to do so but I can go through all the steps only with the local development token and when I am trying to authorize with Basic Auth in Postman I keep getting 401.

What can be done to resolve this issue?
Are there any other methods of authorization like Oauth specifically for Assets HTTP API? I can see a lot of documentation about it but none specify if it can be used for assets.

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi @Alex__Canva ,

 

I am not sure about your exact use case, but I used Assets HTTP API delete method for Assets on cloud service. Below are screenshots for your reference -

Request - http://localhost:4502/api/assets/1/1.png

Authorization - Basic Authorization

manpreetk908_0-1633440426676.png

 

In case you are trying to connect to a server, replace local host with the server details.

 

Hope it helps!

 

Regards,

Manpreet

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @Alex__Canva,

 

Try below steps:

  1. Make sure server is up and running
  2. The user that you are trying to add in the basic auth should have the access to the server
  3. Try logging in with the same user name and pwd and access the URL in the browser to check the same. Ex: https://<aem-url>/content/dam/<asset-folder>.initiateUpload.json
  4. Suggested solution is to create a system user and provide the required access and access the server

Hope this helps.

 

Thanks,

Kiran Vedantam.

 

Avatar

Community Advisor

Hi @Alex__Canva,

If we are accessing AEM as cloud service instance (as available/hosted in the cloud) from any external application, we need to use "Token Based Authentication"/ Bearer type. 

In this case, external application is Postman.

If we are accessing any local AEM instance / SDK instance, we can use Basic Authentication.

Avatar

Level 2

Hello,
Are you sure that Basic Authentication cannot be somehow enabled? As you can see in this example AEM as Cloud Service is used.

Avatar

Community Advisor

Hi @Alex__Canva,

Generally for AEM as a cloud service, we gain access to the instance(as available in cloud) via IMS authentication (which works by using the OAuth protocol between AEM and the Adobe IMS endpoint)

We do have local logins as well but that is only available for admin tasks in which case HTTP Basic authentication should work. (that is if you have credentials which has access and works through local login in cloud service instance, that should work with Basic type. Otherwise, it will be 401)

 

Vijayalakshmi_S_1-1633442741551.png

Reference: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/security/ims-support.html

Avatar

Correct answer by
Level 4

Hi @Alex__Canva ,

 

I am not sure about your exact use case, but I used Assets HTTP API delete method for Assets on cloud service. Below are screenshots for your reference -

Request - http://localhost:4502/api/assets/1/1.png

Authorization - Basic Authorization

manpreetk908_0-1633440426676.png

 

In case you are trying to connect to a server, replace local host with the server details.

 

Hope it helps!

 

Regards,

Manpreet