AzureAD: The user or administrator has not consented to use the application with ID ''
I have recently been working on a Multi-tenant Web Application that makes use of delegated permissions. After developing the application for a while I found that I needed to add another delegated permission to the application which I did using the normal methods. However, when I tried to make use of the new delegated permission with the test user I had been using for a while I didn’t get prompted for the application’s consent as I did originally and I ran into the error:
The user or administrator has not consented to use the application with ID ‘<App ID>’
However, when I used a completely new user who hadn’t used the web application before, there were no issues at all. This led me to believe that there was a problem with the new delegated permission not applying to my normal test user, I had expected a new prompt for consent when I went to access the application given that the permissions had changed, however this didn’t happen and therefore led me to believe that the issue was related to this change and me never granting the consent for the additional permissions. I scoured the internet for any documented help with this but I wasn’t able to find anything, certainly not documented. I was able to solve the issue in the end by revoking the consent for the test user and re-logging into the application and therefore re-consenting but with the new permissions. This can be done as follows:
- Navigate to https://myapps.microsoft.com
- Click on the properties for the App and click on remove
- Log out of the application or open a new in-private browser session and you will get prompted for consent
- Delegated permissions will now work.