简体   繁体   English

Java桌面应用程序中的Azure Multifactor身份验证

[英]Azure Multifactor authentication in java desktop application

I need to authenticate via azure ad in my application. 我需要在应用程序中通过天蓝色广告进行身份验证。 I found this example code: https://github.com/Azure-Samples/active-directory-java-native-headless but my azure is configured with MFA and I get this error: 我找到了以下示例代码: https : //github.com/Azure-Samples/active-directory-java-native-headless,但是我的azure配置有MFA,但出现此错误:

{"error_description":"AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000003-0000-0000-c000-000000000000'.\r\nTrace ID: 643e8491-904a-4cea-b2a6-c720dda97f00\r\nCorrelation ID: 946f5469-c2b3-4de4-8c92-ab73aabc13d3\r\nTimestamp: 2018-08-27 12:59:25Z","error":"interaction_required"}

And now I'm not sure how to provide verification code to my application. 现在,我不确定如何为我的应用程序提供验证码。 Does anyone has any example code, wiki how to use it with MFA? 没有人有任何示例代码,维基如何在MFA中使用它?

This sample should help you. 该示例应为您提供帮助。 It uses OpenID connect with a Java application. 它使用OpenID与Java应用程序连接。

As for your error, in AAD, if you do an initial login in one location, and then login from another location, there are conditions on the AD that flag this as "risky activity". 对于您的错误,在AAD中,如果您先在一个位置进行初始登录,然后从另一位置登录,则AD上存在一些条件将其标记为“危险活动”。

So for your account there is a "moved to a new location" flag that can get set, automatically triggering the need for MFA. 因此,对于您的帐户,可以设置一个“移至新位置”标志,从而自动触发对MFA的需求。 If you do face this, check the conditional access locations in Azure and see if you can clear the flag. 如果确实遇到这种情况,请检查Azure中的条件访问位置,并查看是否可以清除该标志。 (Or set up the original account with named locations in place.) (或设置具有指定位置的原始帐户。)

https://docs.microsoft.com/en-us/azure/active-directory/active-directory-conditional-access-locations https://docs.microsoft.com/zh-cn/azure/active-directory/active-directory-conditional-access-locations

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

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