1

I am trying to create a local c# application, which creates CSV files to put into a datalake.

As this is a demo account, i have made minimum effort in keeping stuff confidential, as all will be wiped soon anyways, and nothing i use the trial account for holds any value.

I have created the app, and assigned the user i want to use through the portal (pictures below), but i get the following error when i run my program:

The user or administrator has not consented to use the application with ID '3a9548f5-4b49-4506-8488-9a377b205e4d' named 'Demo'

I use the following line to authenticate:

ServiceClientCredentials adlCreds = await UserTokenProvider.LoginSilentAsync("3a9548f5-4b49-4506-8488-9a377b205e4d", "bokdemo.onmicrosoft.com", "demo@bokdemo.onmicrosoft.com", "XXXXXX");

The application permissions look like this Application permissions

If i got to the user Demo, and view all applications under that user, i get the following user- applications

The app is created as a native app, with a link to my Datalake as redirect url.

Bok
  • 537
  • 5
  • 21
  • What is the `"XXXXXX"` you have redacted? – juunas Feb 20 '18 at 17:36
  • Possible duplicate of [The user or administrator has not consented to use the application - Send an interactive authorization request for this user and resource](https://stackoverflow.com/questions/40109711/the-user-or-administrator-has-not-consented-to-use-the-application-send-an-int) – Shridhar R Kulkarni Feb 21 '18 at 03:41
  • XXXX represents the password of user demo – Bok Feb 21 '18 at 08:50

1 Answers1

0

The issue has been fixed. I am not sure why the issue was fixed, yesterday it was a problem. today i booted the PC, went straight into the azure portal and selected all permissions, to make sure it wasn't a missed check somewhere.

After giving full AD permissions (9 permissions in total) i tested the program, and it authorized. I then proceeded to remove all the new permissions, only using my original settings and now it still authorises.

I am not sure why this happend, but my issue is resolved.

Bok
  • 537
  • 5
  • 21
  • You're probably looking for this section in the docs: https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols-oauth-client-creds#request-the-permissions-from-a-directory-admin - You'll have to construct that URL yourself, log-in as a tenant admin and give consent. You are then granted on-behalf admin permissions to your app for all users in that tenant. – evilSnobu Feb 21 '18 at 10:37