Expand my Community achievements bar.

Authentication to aio app builder from custom mcp

Avatar

Level 4

Hi,

 

I am currently working on assets with metadata migration task using the aio app builder. Calling the aio app builder code from custom MCP in AEM. When trying to make a call to app builder worker from custom mcp i am getting 401 authorization header is missing. I would like to know how to solve this issue. As it is expecting aio login token and org id from custom mcp also the login token will get refreshed every 24hrs, do we need to write a logic to generate the login token by passing the client credentials? Please let me know if anyone aware of this.

 

 

Thanks,

Bhavani Bharanidharan

Topics

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

2 Replies

Avatar

Adobe Champion

To make use of the standard aio endpoint authentication you would likely need to implement the full oauth token generation process in your codebase, taking your client key etc and using the token API to convert this into a token.  You could potentially cache this for a period of time to avoid every call to the service needing to generate a new token.

 

An alternative approach would be to look at disabling the "adobe auth" option in the adobe io worker, then implement your own authentication, eg pre-shared key etc.  This potentially simplifies the flow, but you need to consider the security impact of doing this as the adobe io API endpoint is effectively public.

 

You can disable the out of the box auth requirement for the endpoint by updating the manifest.yml

        annotations:
          require-adobe-auth: true

 

 

Avatar

Level 4

Hi @martin_ecx_io ,

 

Thanks for your suggestion. I have added the logic to create a access token using the client credentials. Now I can able to see that i am not getting 401 unauthorised error, but getting 204(No content) status code. When i check the logs in app builder, i am not able to see any request is triggered at that time. 

 

Workaround: When i hit the same app builder url from postman, i am getting 204(No Content) status code. 

My doubt, i do have some logs added at starting of the execution. Even that is not getting prinited in the aio runtime activation logs.Do you have any idea about this? 

 

 

Thanks in advance!

 

Regards,

Bhavani Bharanidharan