none
How to use search REST api to get custom managed property data for anonymous user? RRS feed

  • Question

  •  

    I am trying build a public portal with anonymous access and i am trying to read some content from custom managed property using search REST api in sharepoint 2013. I have tried to enable all possible attributes of the managed prop. Like searchable,queryable,safe etc. also i am including queryparametertemplate in my REST api search query. But still i am not able to retrieve the managed prop. For an anonymous user. The same query returns the value if i am logged in.

    Any Help is greatly appreciated. 

    Thanks,

    Rakesh


    Thanks, Rakesh

    Saturday, November 1, 2014 11:54 PM

Answers

  • Hi Rakesh,

    When the Limited-access user permission lockdown mode feature is enabled, permissions for users with “limited access” permissions, such as Anonymous Users, are reduced, preventing access to Application pages including item properties or list views. Additionally, if a document, folder, or library has unique permissions, those users will not be able to:

    • Use the drag and drop feature to upload documents
    • Browse to the affected folder
    • Use the Shared with feature
    • Open documents in the Office client
    • Some callout features on documents and folders will not render as expected.

    But the pages stored in Pages libraries or document libraries or at root level within SharePoint (Wiki pages) are Site Pages, they are not Application pages. So they can be accessed.

    https://akifkamalsyed.wordpress.com/2010/06/12/sharepoint-application-pages-vs-site-pages/

    Thanks,

    Victoria

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Victoria Xia
    TechNet Community Support

    • Marked as answer by Rakesh Kesavan Wednesday, November 5, 2014 5:01 PM
    Wednesday, November 5, 2014 5:21 AM
    Moderator

All replies

  • Hi Rakesh,

    To enable anonymous Search REST queries, we need to create queryparametertemplate.xml and upload it to the correct library in SharePoint.

    From your description I can know that you have created the file, then I recommend to check the things below:

    1. Please use “QueryTemplatePropertiesUrl” instead of “queryparametertemplate” in the Search REST API query as following: &QueryTemplatePropertiesUrl='spfile://webroot/queryparametertemplate.xml'.
    2. Make sure that the Query Properties you need have been added to the QueryProperties element in the queryparametertemplate.xml file.
    3. Make sure that the query parameters you need have been added to the WhiteList element in the queryparametertemplate.xml file. For example, if you want to use Refiners in the REST API, then the Refiners should be added to the WhiteList element in the queryparametertemplate.xml file as following: <a:string>Refiners</a:string>.

    You can also debug setting properties in anonymous Search Rest queries following the link below:

    http://www.mavention.com/blog/debugging-setting-properties-anonymous-search-rest-queries

    More references about anonymous Search REST:

    http://blog.mastykarz.nl/configuring-sharepoint-2013-search-rest-api-anonymous-users/

    http://msdn.microsoft.com/en-us/library/office/jj163876%28v=office.15%29.aspx#bk_AnonymousREST

    Thanks,

    Victoria

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Victoria Xia
    TechNet Community Support

    Monday, November 3, 2014 7:21 AM
    Moderator
  • Thanks for the reply Victoria. I am still unable to retrieve my custom managed property. I just noted that our site collection has "Limited-access user permission lockdown mode" enabled. May be that's the reason why the anonymous user is unable to read the managed property value but interestingly the list that contains the data is also part of anonymous site. 


    Thanks, Rakesh

    Monday, November 3, 2014 5:32 PM
  • Hi Rakesh,

    The Limited-access user permission lockdown mode feature will prevent anonymous users from accessing to Application pages including item properties or list views, so you need to deactivate it.

    More references about this feature:

    http://www.sharepointblogs.be/blogs/vandest/archive/2013/01/26/sharepoint-2013-and-anonymous-users-accessing-lists-and-libraries.aspx

    http://office.microsoft.com/en-001/office365-sharepoint-online-enterprise-help/enable-or-disable-site-collection-features-HA102772720.aspx

    Thanks,

    Victoria

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Victoria Xia
    TechNet Community Support

    Tuesday, November 4, 2014 1:56 AM
    Moderator
  • Hi Victoria, Due to our company security policy I cannot disable the feature. Is there a way to retrive the custom managed property that is not security trimmed for anonymous user using the REST search api? I also figured out that the contents in the pages library of anonymous sites are accessible via search even when the lockdown feature is enabled. Is there a way to open up my custom list similar to how pages library in the anonymous site? Thanks for the help.

    Thanks, Rakesh


    Tuesday, November 4, 2014 3:06 AM
  • Hi Rakesh,

    Per my test, if the Limited-access user permission lockdown mode feature is enabled, the lists cannot be accessed by anonymous users and they cannot be searched either.

    So if you want to make anonymous users be able to search the lists, then you need to deactivate the feature.

    Thanks,

    Victoria

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Victoria Xia
    TechNet Community Support

    Wednesday, November 5, 2014 2:18 AM
    Moderator
  • Hi Victoria,
    That makes sense. So there is no way to open a list to anonymous users in Limited-access user permission lockdown mode. But interestingly Pages library is open to anonymous users in Limited-access user permission lockdown mode. Is there a way to open a list like how Pages library is open for anonymous users in Limited-access user permission lockdown mode. 

    Thanks,

    Rakesh



    Thanks, Rakesh

    Wednesday, November 5, 2014 3:54 AM
  • Hi Rakesh,

    When the Limited-access user permission lockdown mode feature is enabled, permissions for users with “limited access” permissions, such as Anonymous Users, are reduced, preventing access to Application pages including item properties or list views. Additionally, if a document, folder, or library has unique permissions, those users will not be able to:

    • Use the drag and drop feature to upload documents
    • Browse to the affected folder
    • Use the Shared with feature
    • Open documents in the Office client
    • Some callout features on documents and folders will not render as expected.

    But the pages stored in Pages libraries or document libraries or at root level within SharePoint (Wiki pages) are Site Pages, they are not Application pages. So they can be accessed.

    https://akifkamalsyed.wordpress.com/2010/06/12/sharepoint-application-pages-vs-site-pages/

    Thanks,

    Victoria

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Victoria Xia
    TechNet Community Support

    • Marked as answer by Rakesh Kesavan Wednesday, November 5, 2014 5:01 PM
    Wednesday, November 5, 2014 5:21 AM
    Moderator
  • Thank you very much Vicotria. you are the best. I appreciate your help. I was able to create a document library and added my custom site column to the document library. Now I can use content search web part to show the custom value for anonymous users. Even with the Limited-access user permission lockdown mode  feature enabled on the site. I am now able to show the managed property value on the page using cswp webpart.

    Thanks, Rakesh

    Wednesday, November 5, 2014 5:04 PM