简体   繁体   中英

User credential verification failed when creating new project in VS2015

I create a new MVC project and Change the Authentication to Work and School accounts . Then I enter my domain like tennant.onmicrosoft.com and hit OK. I then get presented a log in window. I enter the credentials of a user which has the Global Admin role. After a few seconds I get an error message saying:

User credential verification failed. Error: The user account '...' doesn't have the required permissions to access the domain "tennent.onmicrosoft.com"

The user I used is created using the manage.windowsazure.com website.

I ran into this issue as well, and have spent 4 hours in repairing and generating new AAD domain admin account to no avail. In the end here is the steps I figured out to get this issue resolved - no Root Cause is identified.

  1. From within VS.NET 2015 IDE, File, Account Settings
  2. In my machine couple of accounts are listed (but all with the same Account ID and a warning message to reauthenticate). I removed all these existing accounts.
  3. On the same page I click the Sign In button, and re-enter the account, and pass through all the steps successfully.

  4. Now i switch back to create a new ASP.NET MVC project, and use the Work and School account option: interestingly enough, the account and org info in step 3 are auto populated here, and no even prompts to reauthenticate my non-MSA account. From now on everything is back on track with no issue.

I don't have a root cause, but i suspect the authentication info is persisted somewhere but expired. Some posts say the persisted authentication info is saved in web.config or app.config. I also cleared out all IE cookies which did not resolve my issue. Don't know for sure where those config files are located either.

I am happy to get the issue fixed to focus on my AAD Graph API testing...

Are you using a user that is administrator of the tenant ?

When you use the VS assistant to configure AD Authentication, it creates a new application in Azure Active Directory, so the user should be administrator.

Hope this helps,

Julien

Where did you get the credential from? We often create a web app to get the credential. Make sure the web app is created in tennant.onmicrosoft.com domain.

Oh,I find the credential you said is not the credential I said. ^▽^

在此处输入图片说明 在此处输入图片说明

Set No Authentication, if you use Web API, tick it. If you want to access Azure, you could operate in the back code. Use clientId and key to generate credential and accesstoken. There are some tutorials to help you create Azure project:

For me the answer was to use the First Domain registered on that account!

when I logged out of vs2017 and logged back in again, Then created a new project, select work or school, it auto filled in the first domain I created and that worked!

hope

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM