Dear all, Thanks for your response now it is resolved.
Solved! Go to Solution.
Views
Replies
Total Likes
In your scenario, POSTMAN is replaced by AEM to access the API endpoint, hence you may not need -- post.setHeader("Postman-Token", "xxxx");
You may go through following links to set up OAuth. There are a lot of articles available on AEM-OAuth integration in this forum and on web:
https://aemcorner.com/adobe-granite-oauth-authentication-handler/
Views
Replies
Total Likes
I'm unable to understand why do you want to pass postman-token in this request.
For bearer token try this --
post.setHeader("Authorization", "Bearer " + token);
or
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", "Your Oauth token");
For passing json, you have already written the code to set the body/json in HttpEntity -- post.setEntity(requestEntity);
Views
Replies
Total Likes
Dear Gaurav,
Thanks a lot for your reply. Please see my comments in below.
I'm unable to understand why do you want to pass postman-token in this request.
My requirement is that I need all cm:title from Alfresco APIthrough post request in AEM and show in the AEM page through component.
In Postman I am posting request and getting response while passing below in body.
In Postman I am using authorization as Bearer Token.
I am not sure if I need to use that token "or" not in AEM. Also that token is expired in every 1 hr. I think we need that token in AEM , because the API is not public one . To get/post request for API we should use oauth token.
Please suggest.
Thanks a lot.
Views
Replies
Total Likes
In your scenario, POSTMAN is replaced by AEM to access the API endpoint, hence you may not need -- post.setHeader("Postman-Token", "xxxx");
You may go through following links to set up OAuth. There are a lot of articles available on AEM-OAuth integration in this forum and on web:
https://aemcorner.com/adobe-granite-oauth-authentication-handler/
Views
Replies
Total Likes
Thanks , it is resolved now.
Views
Replies
Total Likes
Enable/Configure debug logs on "com.sunita.wpr.aem", "org.apache.http" and "org.apache.sling" and check
Do you see this servlet/service registered and enabled in felix console?
What do you see in the browser console logs? Use developer tools or Fiddler or any other proxy and check the headers on request/response
Check if there are any errors related to CORS/CSRF/Referrer Filter?
Views
Replies
Total Likes
Views
Likes
Replies