Expand my Community achievements bar.

SOLVED

consuming content headless aem 6.5 oauth or token authentication

Avatar

Level 7

hi,

 

We have lot of content fragments authored and used in various aem pages.

Now, the same content fragments need to be consumed in a non-aem / reactjs , webcomponents projects.

 

Is there any documentation or implementation details, links on authenticating requests from other non-aem applications to consume content fragments?

 

Thanks,

Sri

Topics

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 

I answered a similar question recently, please check my response there: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-access-aem-api-for-...

 

Hope this helps



Esteban Bustamante

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi, 

I answered a similar question recently, please check my response there: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-access-aem-api-for-...

 

Hope this helps



Esteban Bustamante

Avatar

Level 4

Hi @sreenu539 

 

To authenticate requests from non-AEM applications to consume content fragments, you can use the Adobe Experience Manager Assets API. The API provides a way to access and manage content fragments programmatically.

Here is an example of how you can use the API to retrieve a content fragment:

 

json

Open In Editor
1GET /api/assets/{fragment-id}.json

 

 

You can also use the Authorization header to authenticate your requests. For example:

 

http

Open In Editor
1GET /api/assets/{fragment-id}.json 2Authorization: Bearer {access-token}
 

You can obtain an access token by using the OAuth 2.0 protocol. Adobe provides an AEM Gem session on OAuth that explains how to implement OAuth in AEM.

Additionally, you can use the Adobe Experience Manager Assets API - Content Fragments documentation to learn more about the available endpoints and parameters.

For ReactJS and WebComponents projects, you can use the API to retrieve the content fragments and then render them in your application.

Please let me know if you need more information or have any specific questions on how to implement this

Avatar

Level 7

I am using persistent queries, assets api might not be useful for persistent query.

 

I looked at AEM Gem session, could not grasp it.

 

Is it that I create a client app on aem security services and then  

1) make a call to authorization url, to get authorization code

2) make a call to token url using authorization code to get auth token

 

then use auth token to make actual request to /graphql endpoint ?

 

Is my understanding correct? 

 

Thanks,

Sri