简体   繁体   English

在VS2015中创建新项目时,用户凭据验证失败

[英]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 . 我创建一个新的MVC项目,并将“身份验证”更改为“ Work and School accounts Then I enter my domain like tennant.onmicrosoft.com and hit OK. 然后,输入tennant.onmicrosoft.com域名,然后单击“确定”。 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" 错误:用户帐户“ ...”没有访问域“ tennent.onmicrosoft.com”所需的权限

The user I used is created using the manage.windowsazure.com website. 我使用的用户是通过manage.windowsazure.com网站创建的。

I ran into this issue as well, and have spent 4 hours in repairing and generating new AAD domain admin account to no avail. 我也遇到了这个问题,花了4个小时来修复和生成新的AAD域管理员帐户,但无济于事。 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 在VS.NET 2015 IDE中,文件,帐户设置
  2. In my machine couple of accounts are listed (but all with the same Account ID and a warning message to reauthenticate). 在我的机器中,列出了几个帐户(但是所有帐户都具有相同的帐户ID和警告消息以重新进行身份验证)。 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. 现在,我切换回创建一个新的ASP.NET MVC项目,并使用“工作和学校”帐户选项:有趣的是,此处自动填充了步骤3中的帐户和组织信息,甚至没有提示重新验证我的非MSA帐户。 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. 一些帖子说,持久的身份验证信息保存在web.config或app.config中。 I also cleared out all IE cookies which did not resolve my issue. 我还清除了所有无法解决问题的IE cookie。 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... 我很高兴解决此问题,专注于我的AAD Graph API测试...

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. 使用VS助手配置AD身份验证时,它将在Azure Active Directory中创建一个新应用程序,因此用户应为管理员。

Hope this helps, 希望这可以帮助,

Julien 朱利安

Where did you get the credential from? 您是从哪里获得证书的? We often create a web app to get the credential. 我们经常创建一个Web应用程序来获取证书。 Make sure the web app is created in tennant.onmicrosoft.com domain. 确保在tennant.onmicrosoft.com域中创建了Web应用程序。

Oh,I find the credential you said is not the credential I said. 哦,我发现您说的凭证不是我说的凭证。 ^▽^ ^▽^

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

Set No Authentication, if you use Web API, tick it. 设置无身份验证,如果您使用Web API,请勾选它。 If you want to access Azure, you could operate in the back code. 如果要访问Azure,可以在后台代码中进行操作。 Use clientId and key to generate credential and accesstoken. 使用clientId和key生成凭据和访问令牌。 There are some tutorials to help you create Azure project: 有一些教程可帮助您创建Azure项目:

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! 当我退出vs2017并再次登录后,然后创建一个新项目,选择公司或学校,它会自动填写我创建的第一个有效的域!

hope 希望

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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