首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在OAuth2上使用多因素身份验证为Azure Active Directory工作

如何在OAuth2上使用多因素身份验证为Azure Active Directory工作
EN

Stack Overflow用户
提问于 2020-05-10 05:15:39
回答 1查看 575关注 0票数 0

我们在Azure Active Directory上使用Azure 2.0身份验证码授权来使用http://guzzlephp.org/对web应用程序中的用户进行身份验证

这已经没有问题了,但是现在AD维护人员想要部署多因素身份验证。我们目前的OAuth实现并不符合这一点。

下面是我们的代码:

代码语言:javascript
复制
        $url = 'https://login.windows.net/' . $directoryIdAzure . '/oauth2/token'
            /** @var GuzzleHttp\Client $client **/
            $response = $client->post(
                $url,
                [
                    "headers" => [
                        "Accept" => "application/json"
                    ],
                    'form_params' => [
                        'resource'      => 'https://analysis.windows.net/powerbi/api',
                        'client_id'     => $clientIdAzure,
                        'client_secret' => $clientSecretAzure,
                        'grant_type'    => 'password',
                        'username'      => $user,
                        'password'      => $pass,
                        'scope'         => 'openid',
                    ]
                ]
            );``` 

Return this error:



error: 
 "error": "interaction_required",
    "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
EN

回答 1

Stack Overflow用户

发布于 2020-05-11 20:55:35

微软建议您不要使用ROPC flow。在大多数情况下,可以使用并推荐更安全的替代方案。此流程需要对应用程序具有非常高的信任度,并且会带来其他流程中不存在的风险。只有在无法使用其他更安全的流时,才应该使用此流。

此OAuth 2.0资源所有者密码凭据授予不支持多因子身份验证。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61703839

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档