WebAuthn | Registration

WebAuthn 등록에는 클라이언트 (브라우저), 인증자 (보안 디바이스), relying party(RP; TsgcWSAPIServer_WebAuthn delphi/cbuilder 서버)가 관련됩니다.

 

등록 옵션

 

새 사용자 자격 증명을 생성하려면 일반적으로 클라이언트가 TsgcWSAPIServer_WebAuthn 서버에 구성된 Registration Options Endpoint에 새 HTTP 요청을 사용하여 등록 흐름을 시작해야 합니다. 기본적으로 엔드포인트는 /sgcWebAuthn/Registration/Options이므로, 서버가 https://www.test.com 도메인에서 수신 대기 중인 경우 클라이언트는 https://www.test.com/sgcWebAuthn/Registration/Options url에 새 요청을 해야 합니다.

 

클라이언트는 다음 json을 페이로드로 전달하여 새 요청을 보냅니다(사용자 이름으로 test 사용)

 

{"username":"test","algorithms":[]}

 

서버는 요청을 읽고 새로운 챌린지가 포함된 응답을 반환합니다.

 

{
    "rp": {
        "name": "localhost",
        "id": "localhost"
    },
    "user": {
        "id": "36b9d6a84204487382fee62e7e67a80d",
        "name": "test",
        "displayName": "test"
    },
    "challenge": "6c6c468c99f24bf29a85a15b661f75f385654f97309c46bab2909c926e17ccbe",
    "pubKeyCredParams": [
        {
            "type": "public-key",
            "alg": "-7"
        },
        {
            "type": "public-key",
            "alg": "-257"
        }
    ],
    "timeout": 60000,
    "excludeCredentials": [],
    "authenticatorSelection": {
        "residentKey": "preferred",
        "requireResidentKey": false,
        "userVerification": "preferred"
    },
    "attestation": "direct",
    "hints": [],
    "extensions": {
        "credProps": true
    }
}

 

응답은 다음 데이터를 반환합니다:

 

 

 

Registration Verify

 

이제 클라이언트가 서버로부터 응답을 받았고, 응답을 읽으며 인증자가 암호화 데이터를 클라이언트 웹 브라우저에 반환합니다. 이제 클라이언트는 TsgcWSAPIServer_WebAuthn 서버에 구성된 Registration Verify Endpoint(기본값은 /sgcWebAuthn/Registration/Verify)로 다음 데이터와 함께 새 HTTP 요청을 보냅니다

, 따라서 서버가 https://www.test.com 도메인에서 수신 대기 중인 경우 클라이언트는 https://www.test.com/sgcWebAuthn/Registration/Verify url에 새 요청을 해야 합니다.

 

authenticator가 브라우저의 JavaScript에 다음과 함께 응답합니다.

 

 

아래에서 예제를 확인하십시오:

 

{
    "id": "yeA4BVRlrAfLG-KzqsL_rlI4ffhuKHK8uoEkVoab065UkS82Zqlh9VFQHIYwOuOo",
    "rawId": "yeA4BVRlrAfLG-KzqsL_rlI4ffhuKHK8uoEkVoab065UkS82Zqlh9VFQHIYwOuOo",
    "response": {
        "attestationObject": "o2NmbXRmcGFja2VkZ2F0dFN0....",
        "clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uY3Jl....",
        "transports": [
            "nfc",
            "usb"
        ],
        "publicKeyAlgorithm": -7,
        "publicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj....",
        "authenticatorData": "SZYN5YgOjGh0NBcPZHZgW4_k...."
    },
    "type": "public-key",
    "clientExtensionResults": {
        "credProps": {
            "rk": true
        }
    },
    "authenticatorAttachment": "cross-platform"
}

 

서버는 클라이언트로부터 JSON 요청을 읽고 공개 키와 credential ID를 디코딩, 검증 및 저장합니다.

 

attestationObject와 clientDataJSON을 디코딩합니다:

 

 

Store Credential:

 

 

 

 

등록 흐름

다음 링크를 사용하여 Registration Flow 프로세스에 대한 자세한 정보를 얻으십시오: