First published on MSDN on Aug 01, 2017
Over this blog, I would like to discuss about one of the interesting issues that we had worked upon recently. Here we are having a SSIS package that uses the OData Source Connection manager to connect to a PWA (Project Web App) – Project Online URL to pull the data and write back to a SQL Server table. This SSIS package was scheduled to run under a SQL Agent Job and while executing the SQL Agent Job, it failed with the following error messages,
Error message from the SSIS package execution report:
While testing the connection for the OData connection manager of the same package from Visual Studio -SQL Server Data Tools (SSDT), we received the following error message,
Test connection failed
The remote server returned an error: (401) Unauthorized. (System)
at Microsoft.SqlServer.IntegrationServices.OData.UI.ODataConnectionManagerForm.TestConnectionMiddle(Object callback)
As a part of our troubleshooting activity, we had collected a fiddler traces while reproducing the issue and we were able to see the following.
After some internal research, we were able to identify the cause of the issue as below.
Most current Office mobile and desktop applications use modern authentication (which is an implementation of OAuth2), however there are third-party apps, older Office apps & Visual studio applications (SSDT-SSIS) that uses other authentication methods like basic authentication and forms based authentication. Most of the times ADFS claims rules are setup to block non-modern authentication protocols which blocks all access to O365 except browser-based applications.
This is controlled by the following settings.
SharePoint Admin Center -> Device access -> Control access from apps that don’t use modern authentication -> Block
We need to set the control access to be allowed for apps that don’t use modern authentication.
SharePoint Admin Center -> Device access -> Control access from apps that don’t use modern authentication -> Allow
Post this change, we were able to access the PWA – Project Online URL without any issues.
There could be multiple other reasons for the “(401) Unauthorized” error, in this blog, we have tried to address one such reason for this error to be thrown.