Hi all,
Does the querybuilder.json servlet acknowledges the user authorization when searching? Can I pass user credential so the Querybulider.json will only return what that user suppose to see ? If yes, how do i pass user credential via URL ?
Any pointers would be greatly appreciated.
Hi,
querybuilder.json is like every other http service given by cq, authorizing only registered credentials (among which is anonymous) and retrieving the data that associated JCR session is allowed to read.
if you are in a secured network, or just playing with features, you can use basic auth, e.g.
http://admin:admin@localhost:4502/...
or through curl :
curl -u admin:admin http://localhost:4502/...
There are other ways of authentication (see login page code e.g.)
Thank you for the info.
This is what I tried:
Site:
/content/mysite/sample-press-releases
- /content/mysite/sample-press-releases/pressrelease/pr1
- /content/mysite/sample-press-releases/pressrelease/pr2
- /content/mysite/sample-press-releases/pressrelease/pr3
- /content/mysite/sample-press-releases/pressrelease/pr4
User:
I have a user_A which has read access to pr1 and pr2 only
But when I tried http://user_A:cq123@localhost:4503/bin/querybuilder.json?path=/content /mysite/sample-press-releases&type=cq:Page
I get all 4 results. I just want to get pr1 and pr2 which user_A is authorized to view.
Yes a publish instance must be readable for an anonymous user, whereas an author instance isn't.
Depending on the runmode (cf. http://www.pro-vision.de/adaptto/downloads/2011_lightning_Runmodes_and _Configs_for_Fun_and_Profit.pdf) the author runmode will redirect anonymous to the login if a resource is not readable to him, the publish runmode will just finish here (and retrieve 404).
Here are the results of my experiments:
Setup:
Site:
/content/mysite/sample-press-releases
- /content/mysite/sample-press-releases/pressrelease/pr1
- /content/mysite/sample-press-releases/pressrelease/pr2
- /content/mysite/sample-press-releases/pressrelease/pr3
- /content/mysite/sample-press-releases/pressrelease/pr4
User:
I have a user_A which has read access to pr1 and pr2 only
Author:
- Takes me to login page
- Log in as user_A
- I see content as expected
- /content/mysite/sample-press-releases/pressrelease/pr1
- /content/mysite/sample-press-releases/pressrelease/pr2
Publish:
- DOES NOT takes me to login page
- I see content as unexpected
- /content/mysite/sample-press-releases/pressrelease/pr1
- /content/mysite/sample-press-releases/pressrelease/pr2
- /content/mysite/sample-press-releases/pressrelease/pr3
- /content/mysite/sample-press-releases/pressrelease/pr4
I would want to set up Publish environment in a way that it is only public for local network so their partly applications like portal can make REST query and retrive content based on user credential. Also how do I by pass the user login page? adding http://user_A:cq5:localhost: didnt work for me.
Thanks for the pointers !!
As noted, ACLs you create on the author don't get over to a publish automatically, and all activated content is readable by anonymous by default, assuming a public website.
You probably want to look into "closed user groups" to set up ACLs and custom logins on the publish.
http://dev.day.com/docs/en/cq/current/howto/create_apply_cug.html
Yeah, the reason is explained in this page.
http://dev.day.com/content/kb/home/cq5/CQ5SystemAdministration/ACLRepl ication.html
I think everyones answer help me wrap this concept around my head.
Thank you all.
North America
Europe, Middle East and Africa
Asia Pacific