# SharePoint - "Error: 917656" when using AuthScheme=SharePointOAuth"

**URL:** <https://community.cdata.com/t/sharepoint-error-917656-when-using-authscheme-sharepointoauth/903>\
**Category:** Data Sources\
**Tags:** article, microsoft, sharepoint\
**Created:** [September 18, 2024, 8:57pm UTC](https://community.cdata.com/t/sharepoint-error-917656-when-using-authscheme-sharepointoauth/903 "2024-09-18T20:57:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luçjano\_Capo](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/lu%C3%A7jano_capo/32/1638_2.png) [@Luçjano\_Capo](https://community.cdata.com/u/Lu%C3%A7jano_Capo)\
**Post date:** [September 18, 2024, 8:57pm UTC](https://community.cdata.com/t/sharepoint-error-917656-when-using-authscheme-sharepointoauth/903/1 "2024-09-18T20:57:35Z")

</div>

Error: 917656; Access denied. Before opening files in this location, you must first browse to the web site and select the option to login automatically".&nbsp;  
&nbsp;  
This error originates from Microsoft and occurs when the app’s permissions are not set from the _tenant-admin-url_. To resolve this issue, kindly follow these steps:

**Registering the Add-In**

1. Navigate to the Register Add-In page by entering the url as: https://{sitename}.SharePoint.com/\_layouts/15/appregnew.aspx.

2. In the “App Information” section, click  **Generate** , which is located next to the Client Id and Client Secret textboxes to generate the respective values.

3. Set Title, App Domain, and Redirect URI by filling in their respective text boxes.

4. Click  **Create.**

The add-in is registered, and the Sharepoint App displays the created information.

 ![ad25c118-ede0-4fa3-b61c-15763213955d.png](https://us1.discourse-cdn.com/cdata/original/2X/3/3bb244d613c311c3042ac553f227c829a43a484e.png)

**Granting Permissions to the Add-In**

1. Navigate to the SharePoint site.

2. Enter the URL: https://{sitename}-admin.sharepoint.com/\_layouts/15/appinv.aspx in the browser. This redirects to the Grant Permission page.

3. At  **App Id,** enter the Client ID which you generated earlier, and click  **Lookup**. This populates the values in the other text boxes (Title, App Domain and Redirect URL).

4. Enter the following permission request in XML format:

\<AppPermissionRequests AllowAppOnlyPolicy=“true”\>

\<AppPermissionRequest Scope=“[http://sharepoint/content/tenant](http://sharepoint/content/tenant)” Right=“FullControl”/\>

\</AppPermissionRequests\>

 ![4facdc3a-c58a-4b40-8693-919ffb4b60ff.png](https://us1.discourse-cdn.com/cdata/original/2X/8/83036a05ab2d28dc364ca5a006abdbfdd1f9f313.png)

1. Click  **Create**. Sharepoint App displays a permission consent dialog. To grant the permissions, click  **Trust It.**

 ![7523f7f9-463d-4ed0-a795-29903121ebb2.png](https://us1.discourse-cdn.com/cdata/original/2X/6/6b4cef00879af244d9c221a56a5ec40f6f9e020c.png)

These steps are also highlighted in the [Microsoft Documentation](https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs) and in our [SharePoint driver documentation](https://cdn.cdata.com/help/RSJ/odbc/pg_spoauthcustomappcreate.htm#:~:text=continue%20to%20authenticate.-,Sharepoint%20App,-To%20create%20a).

Please reach out to [support@cdata.com](mailto:support@cdata.com) if this does not resolve the problem for you.
