WebAuthn Authentication을 사용하면 사용자가 이전에 등록한 공개 키 자격 증명을 사용하여 로그인할 수 있습니다. 등록에서 저장된 사용자의 공개 키를 사용하여 서명된 챌린지를 검증하는 것이 포함됩니다.
인증 옵션
인증을 위해서는 클라이언트가 TsgcWSAPIServer_WebAuthn 서버에 구성된 Authentication Options Endpoint에 새 HTTP Request를 사용하여 인증 흐름을 시작해야 합니다. 기본적으로 엔드포인트는 /sgcWebAuthn/Authentication/Options이므로, 서버가 https://www.test.com 도메인에서 수신 대기하는 경우 클라이언트는 https://www.test.com/sgcWebAuthn/Authentication/Options URL로 새 요청을 해야 합니다.
클라이언트가 POST를 통해 assertion(인증 응답)을 서버로 보냅니다
{"username":"test","user_verification":"preferred"}
서버가 PublicKeyCredentialRequestOptions를 생성합니다
{
"challenge": "9d0d61edf30b45f8b88aef7087f9117716e2b7d8b0ee4460b06142f39dd0ec9f",
"timeout": 60000,
"rpId": "localhost",
"allowCredentials": [
{
"id": "yeA4BVRlrAfLG-KzqsL_rlI4ffhuKHK8uoEkVoab065UkS82Zqlh9VFQHIYwOuOo",
"type": "public-key",
"transports": [
"nfc",
"usb"
]
}
],
"userVerification": "preferred",
"hints": [],
"attestation": "none",
"attestationFormats": [],
"extensions": {}
}
Authentication Verify
인증을 위해서는 클라이언트가 TsgcWSAPIServer_WebAuthn 서버에 구성된 Authentication Verify Endpoint에 새 HTTP Request를 사용하여 인증 흐름을 시작해야 합니다. 기본적으로 엔드포인트는 /sgcWebAuthn/Authentication/Verify이므로, 서버가 https://www.test.com 도메인에서 수신 대기하는 경우 클라이언트는 https://www.test.com/sgcWebAuthn/Authentication/Verify URL로 새 요청을 해야 합니다.
브라우저는 사용자에게 인증자(예: 지문, YubiKey)를 사용하라는 메시지를 표시합니다. 인증자는 credential ID에 연결된 개인 키로 챌린지에 서명합니다. 반환된 자격 증명에는 다음이 포함됩니다:
아래에서 클라이언트 요청의 json 예제를 찾으십시오:
{
"id": "yeA4BVRlrAfLG-KzqsL_rlI4ffhuKHK8uoEkVoab065UkS82Zqlh9VFQHIYwOuOo",
"rawId": "yeA4BVRlrAfLG-KzqsL_rlI4ffhuKHK8uoEkVoab065UkS82Zqlh9VFQHIYwOuOo",
"response": {
"authenticatorData": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MFAAAABw",
"clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ.....",
"signature": "MEQCIAJRqvvys8....",
"userHandle": "36b9d6a84204487382fee62e7e67a80d"
},
"type": "public-key",
"clientExtensionResults": {},
"authenticatorAttachment": "cross-platform"
}
서버는 클라이언트로부터 요청을 읽고, 자격 증명이 저장되어 있는지 검증하고, 서명을 확인합니다. 서명이 유효하면 OnWebAuthnAuthenticationSuccessful 이벤트가 호출됩니다.
다음 링크를 사용하여 인증 플로 프로세스에 대한 자세한 정보를 확인하십시오.