Skip to content

Error 401 when using Access Token created via High Trust Add-in #7237

@ivanmaria

Description

@ivanmaria

I created a high trust add-in for SharePoint OnPrem 2016 by following these steps:
https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/create-high-trust-sharepoint-add-ins

I could successfully create access token for an user. However when I try to access any REST API via Postman, I get the following error message

Request:

GET http://<site url>/_api/web/lists
Authorization: Bearer eyJhb...

Response:

401 UNAUTHORIZED

However, I observed that if 'Anonymous Authentication' is enabled in IIS for SharePoint web application then I am able to access the above REST API but if the 'Anonymous Authentication' is disabled in IIS then I receive 401 UNAUTHORIZED error.

Is Anonymous Authentication a prerequisite for REST APIs in SharePoint on-premise? If not, how do I access REST APIs for high-trust add-in without anonymous authentication?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:add-insCategory: SharePoint Add-in Development Modelarea:docs-commentCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devtype:archive-old-issueIssues which are closed as tool old for active work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions