title: "AADSTS65001: The user or administrator has not consented to use the application" occurs when token is acquired on behalf of a user
body: <p>In Azure AD I created 2 app registrations with the same parameters and I want to use them for different environments. When I use the first registration everything works fine. But after switching to another one I get an error</p>
  <p><code>AADSTS65001: The user or administrator has not consented to use the application with ID</code></p>
  <p>when trying to acquire a token:</p>
  <p><code>var result = await app.AcquireTokenOnBehalfOf(new[] { &quot;User.Read&quot; }, userAssertion).ExecuteAsync();</code></p>
  <p>I have no idea why this error occurs since I configure only one permission and it's not required an admin concent
  <a href="https://i.stack.imgur.com/fuJQd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fuJQd.png" alt="enter image description here" /></a></p>
  <p>On client side I tried  to add a parameter <code>prompt=consent</code> in order to show a dialog for providing permissions by user, but it didn't help.</p>
  <p>Do you have any ideas why this error occurs in my case?</p>