You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
I have a background application which is supposed to connect to Data Catalog and fetch information related to a table. Since its a background application, I cannot have any user intervention to authenticate the Data Catalog request. So I am trying to authenticate using ClientID and ClientSecret instead.
Getting the token using this method is being successful, however when I use this token for the Data Catalog API request, the request returns "401 - Unauthorized: Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials you supplied".
Please suggest what I could be missing here!
The text was updated successfully, but these errors were encountered:
I have a background application which is supposed to connect to Data Catalog and fetch information related to a table. Since its a background application, I cannot have any user intervention to authenticate the Data Catalog request. So I am trying to authenticate using ClientID and ClientSecret instead.
`string authorityUri = "https://login.microsoftonline.com/{adtenanthere}";
string resourceUri = "https://datacatalog.azure.com";
string clientId = "{clientidhere}";
string clientSecret = "{clientsecrethere}";
AuthenticationContext authContext1 = new AuthenticationContext(authorityUri, false);
ClientCredential credential = new ClientCredential(clientId, clientSecret);
AuthenticationResult authResult = authContext1.AcquireTokenAsync(resourceUri, credential).Result;
string token = authResult.CreateAuthorizationHeader();`
Getting the token using this method is being successful, however when I use this token for the Data Catalog API request, the request returns "401 - Unauthorized: Access is denied due to invalid credentials. You do not have permission to view this directory or page using the credentials you supplied".
Please suggest what I could be missing here!
The text was updated successfully, but these errors were encountered: