none
No search result for anonymous user - Access denied error RRS feed

  • Question

  • Hello,

    we have a public web site build on Sharepoint 2013.

    We have build the default web application with Windows Authentication, extended it on HTTPS for anonymous user access.

    All works fine. There is only one problem with search service: when a visitor (anonymous user) try the serach no result are show.

    If i use the authenticated windows user all work fine: the serach work well.

    If i use anonymous user the response is "Access denied" (I have tried the search with powershell).

    How I can authorize anonymous user to make search?

    Thanks

    Lorenzo, from Italy


    LSo Lorenzo Soncini Trento TN - Italy

    Wednesday, November 6, 2019 7:56 PM

All replies

  • After configuring anonymous users access, if you still not able to get results then the issue is with the feature, you have to deactivate the feature Limited-access user permission lockdown mode and perform a full crawl and then try it.

    Below articles for your reference:

    https://nichiporovicha.wordpress.com/2016/11/23/sharepoint-2013-anonymous-users-and-empty-search-results/

    Thanks & Regards,


    sharath aluri

    Wednesday, November 6, 2019 10:15 PM
  • Hi,

    One basic troubleshooting method is to disable and re-enable anonymous access, reset the search index on you site and then do a full crawl.

    Besides what Sharath suggests, you can modify the OSSSearchResults.aspx under this location:

    %Program Files%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS

    Back up the original .aspx file and then remove the line “Inherits=”.

    You can also consider Anonymous search results cache in SharePoint 2013 under specific circumstances.

    Please refer to the links below for detailed information.

    SharePoint search and anonymous users.

    Using the Anonymous search results cache on SharePoint 2013 public-facing websites.

    Another post with similar issue for your reference.

    SharePoint 2013 - Allow anonymous search results.

    Please note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, November 7, 2019 3:01 AM
  • Hello,

    today I have tried the Sharath Aluri suggestion (thanks). I have disabled the feature, cleaned the index and starting a new full crawl.

    I'm waiting the and of the new "crawling" and test the result of this operation.

    Thanks also to Chelsea Wu: I have already tried the basic reset operation before the post "disable and re-enable anonymous access, reset the search index on you site and then do a full crawl." without success.

    After the test of the suggestion from Sharath I try other idea

    The script I used for test:

    [string] $queryText = 'Aria'
    [string] $siteCollectionUrl = "http://sharepoint.domain.it/"

    # Add-PSSnapin -Name Microsoft.SharePoint.PowerShell
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Search")

    $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteCollectionUrl)

    $keywordQuery = New-Object Microsoft.SharePoint.Client.Search.Query.KeywordQuery($clientContext)
    $keywordQuery.QueryText = $queryText

    $searchExecutor = New-Object Microsoft.SharePoint.Client.Search.Query.SearchExecutor($clientContext)
    $results = $searchExecutor.ExecuteQuery($keywordQuery)
    $clientContext.ExecuteQuery()
    $formattedResults = @()

    foreach($result in $results.Value[0].ResultRows)
    {
        $formattedResult = New-Object -TypeName PSObject
        foreach($key in $result.Keys)
        {
            $formattedResult | Add-Member -Name $key -MemberType NoteProperty -Value $result[$key]
        }
        $formattedResults += $formattedResult
    }

    $formattedResults

    Works with the internal windows authenticated URL. If I try the anonymous url [string] $siteCollectionUrl = "http://www.domain.it/" the $clientContext.ExecuteQuery() return the error: Eccezione durante la chiamata di "ExecuteQuery" con "0" argomento/i: "Errore del server remoto: (401) Non autorizzato." (in english: Remote server error: (401) Unauthorized")

    LSo


    LSo Lorenzo Soncini Trento TN - Italy


    Thursday, November 7, 2019 7:59 AM
  • I have tried the solution proposed by Sharath Aluri but does not works.

    I use this script for test:

    # Add-PSSnapin -Name Microsoft.SharePoint.PowerShell
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime")
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Search")

    $siteCollectionUrl = "http://sharepoint.dominio.it/"
    $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteCollectionUrl)
    $keywordQuery = New-Object Microsoft.SharePoint.Client.Search.Query.KeywordQuery($clientContext)
    $keywordQuery.QueryText = $queryText
    $searchExecutor = New-Object Microsoft.SharePoint.Client.Search.Query.SearchExecutor($clientContext)
    $results = $searchExecutor.ExecuteQuery($keywordQuery)
    $clientContext.ExecuteQuery()
    $formattedResults = @()

    foreach($result in $results.Value[0].ResultRows)
    {
        $formattedResult = New-Object -TypeName PSObject
        foreach($key in $result.Keys)
        {
            $formattedResult | Add-Member -Name $key -MemberType NoteProperty -Value $result[$key]
        }
        $formattedResults += $formattedResult
    }
    $formattedResults

    If $siteCollectionUrl use the Windows authenticated address all work well.

    If $siteCollectionUrl use anonymous public site (no authentication) return error:The remote server returned an error: (401) Unauthorized

    The test idenitfy the problem, i think, to the SharePoint Search Service Application and not to the client page.

    Thanks


    LSo Lorenzo Soncini Trento TN - Italy

    Thursday, November 7, 2019 10:32 AM
  • Hi,

    I cannot reproduce this issue in my environment. I have tested with a new web application and search with an anonymous user. The search results return without error.

    I don’t see any configuration needed when enabling Anonymous Access for a web application. Have you done any modification in the Central Administrator? Have you configured Global Search Center for the web application?

    If you suspect issues with the Search Service Application, you can create a new one via Central Administrator > Application Management > Manage service applications > New > Search Service Application.

    After that, change the binding via Manage web applications > Service Connections and select the new Search Service Application. Test again to see the result.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, November 12, 2019 9:56 AM