Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Application Token based Request returning not 401 Unauthorized #3

Open
manthena opened this issue Apr 2, 2017 · 3 comments
Open

Application Token based Request returning not 401 Unauthorized #3

manthena opened this issue Apr 2, 2017 · 3 comments

Comments

@manthena
Copy link

manthena commented Apr 2, 2017

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!

@rajaragothaman
Copy link

Facing same issue...

Manthena ,please let me know if you found any solution.

@manthena
Copy link
Author

Hi @rajaragothaman, I never got this issue resolved. Meanwhile our design changed, so we are no longer using Azure Data Catalog.

If you have this issue resolved, please confirm the solution. It will be useful for everyone.

@ondrejcitek
Copy link

facing the same issue, anyone has resolved this? Any way how to authorize agains Data Catalog REST API? All we can see is 401 Unauthorized :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants