Expand my Community achievements bar.

SOLVED

Search Assets using API via OAuth

Avatar

Level 4

OS: RHEL 7.6
Server: AEM-6.5.1 SP-6.5.13

 

We already implemented our author using SAML. Now we have a requirement to expose a service to Third-party to query our assets via OAuth implementation and the final endpoint should be like below.


http://localhost:4502/bin/querybuilder.json?p.hits=selective&p.properties=sling:resourceType%20jcr:u...

 

I followed this how-to-manage-the-protected-aem-resources-through-oauth-2-0-851ce4c7a5ef document and generated the token and other stuffs but the result is empty with http status 401 when I do the below CURL

 

curl -H "Authorization: Bearer <BEARER_TOKEN>" http://localhost:4502/bin/querybuilder.json?p.hits=selective&p.properties=sling:resourceType%20jcr:u...

 

In this way we didnt have any scope. do we need to write any custom scope and register ? Please guide in right direction.

 

Thanks in advance for your guidance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

I believe you forgot to add the link you are following. Let me know if this is the link you are following:
https://medium.com/tech-learnings/how-to-manage-the-protected-aem-resources-through-oauth-2-0-851ce4...

 

If, this is not the link, please post the one you are following so that we can verify the steps.

If, this is the link, then you will have to follow lot of steps before you can hit the curl command above:


curl -H "Authorization: Bearer <BEARER_TOKEN>" http://localhost:4502/bin/querybuilder.json?p.hits=selective&p.properties=sling:resourceType%20jcr:u...

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

I believe you forgot to add the link you are following. Let me know if this is the link you are following:
https://medium.com/tech-learnings/how-to-manage-the-protected-aem-resources-through-oauth-2-0-851ce4...

 

If, this is not the link, please post the one you are following so that we can verify the steps.

If, this is the link, then you will have to follow lot of steps before you can hit the curl command above:


curl -H "Authorization: Bearer <BEARER_TOKEN>" http://localhost:4502/bin/querybuilder.json?p.hits=selective&p.properties=sling:resourceType%20jcr:u...