简体   繁体   English

管理Azure AD身份验证以获取Windows凭据

[英]Manage Azure AD Authentication getting windows Credentials

I follow this Microsoft Guide to put a Microsoft office 365 authentication in my WPF Application and WEB API. 我遵循此Microsoft指南将Microsoft Office 365身份验证放入WPF应用程序和WEB API中。 All works perfectly, the user open the app and a microsoft popup is shown. 一切运行正常,用户打开应用程序,并显示Microsoft弹出窗口。 After the login the user is able to use my WEB API. 登录后,用户可以使用我的WEB API。 Now, along with this solution, i would like to get the windows credential and authenticate the users automatically in Azure AD. 现在,连同此解决方案一起,我想获得Windows凭据并在Azure AD中自动对用户进行身份验证。

Most of the time, my user is under the same azure tenant domains, so i would like to authenticate it automatically without user interactions. 在大多数情况下,我的用户位于相同的Azure租户域下,因此我想在没有用户交互的情况下自动对其进行身份验证。

Is it a possible Solution or windows authentication can't speak with azure AD? 这是可能的解决方案,还是Windows身份验证无法与Azure AD对话?

I Found a solution watching better in Microsoft Docs: " Acquiring a token with Windows Integrated security If your PC is domain joined or AAD joined, you can also use the Windows-integrated security. For this, instead of calling TextualPrompt(), you need to uncomment the line creating an instance of UserCredential without parameters: See Program.cs 我找到了一个在Microsoft Docs中可以更好地观察的解决方案:“ 通过Windows集成安全性获取令牌如果您的PC已加入域或加入了AAD,您还可以使用Windows集成安全性。为此,您需要调用TextualPrompt()来代替取消注释创建不带参数的UserCredential实例的行的注释:请参阅Program.cs

UserCredential uc = new UserCredential(); UserCredential uc = new UserCredential(); You can trigger the middleware to send an OpenID Connect sign-in request by decorating a class or method with the [Authorize] attribute " 您可以使用[Authorize]属性装饰类或方法来触发中间件发送OpenID Connect登录请求。

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

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