title: Accessing Dynamics CRM via username/password throwing AdalServiceException: AADSTS65001
body: <p>I followed the quickstart here: <a href="https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/enhanced-quick-start" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/enhanced-quick-start</a></p>
  
  <p>Which worked great, so then I need to register my app, so I followed this:
  <a href="https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/walkthrough-register-app-azure-active-directory" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/walkthrough-register-app-azure-active-directory</a></p>
  
  <p>But now my unit tests give me the error:</p>
  
  <blockquote>
    <p>Microsoft.IdentityModel.Clients.ActiveDirectory.AdalServiceException:
    AADSTS65001: The user or administrator has not consented to use the
    application with ID '[GUID]' named '[AppName]'. Send an interactive
    authorization request for this user and resource.</p>
  </blockquote>
  
  <p>I feel like I understand the error, that the administrator needs to consent.  My program is doing some magic in the bakcgorund and the user is not signing in, it is using a set username and password and the user should not be consenting to anyone.  Is there any way to set this consent permanently, or force it every time through the Helper class in the first tutorial?  All my Google-fu came up empty... Thank you.</p>