Reputation: 24799
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.
Upvotes: 0
Views: 1721
Reputation: 9
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
Upvotes: 0
Reputation: 31
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.
On the same page I click the Sign In button, and re-enter the account, and pass through all the steps successfully.
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...
Upvotes: 3
Reputation: 793
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:
https://azure.microsoft.com/en-us/documentation/learning-paths/active-directory-developer/
https://github.com/Azure-Samples/active-directory-dotnet-graphapi-web
Keep contact if you have any questions.
Upvotes: 0
Reputation: 1105
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
Upvotes: 0