首页 > 解决方案 > 通过使用 2FA 的 Okta 进行身份验证

问题描述

我构建了一个简单的 asp.net 核心应用程序,除了用户名和密码之外,还需要对使用 MFA 的帐户进行身份验证。

我尝试登录的服务公开了此处描述的身份验证端点: https ://developer.okta.com/docs/reference/api/authn/#request-example-for-primary-authentication-with-public-application

当我提供用户名和密码时,它会返回预期的 JSON:

{
    "stateToken": "00zQZJ1ZY3Em2401r4T69Dhx35TdF1VTFP5KRTa8ib",
    "expiresAt": "2020-05-30T21:11:14.000Z",
    "status": "MFA_REQUIRED",
    "_embedded": {
        "user": {
            "id": "00u10vk1torIgBBxxxxx",
            "profile": {
                "login": "john.doe@email.com",
                "firstName": "John",
                "lastName": "Doe",
                "locale": "en",
                "timeZone": "America/Los_Angeles"
            }
        },
        "factors": [{
                "id": "ost1g59468dXOddAE0h8",
                "factorType": "token:software:totp",
                "provider": "OKTA",
                "vendorName": "OKTA",
                "profile": {
                    "credentialId": "john.doe@email.com"
                },
                "_links": {
                    "verify": {
                        "href": "https://company.okta.com/api/v1/authn/factors/ost1g59468dXOddxxxxx/verify",
                        "hints": {
                            "allow": ["POST"]
                        }
                    }
                }
            }, {

有谁知道我也可以将 2FA 添加到请求中以使其正常工作?

标签: authenticationoktamulti-factor-authentication

解决方案


推荐阅读