Skip to content

Instantly share code, notes, and snippets.

@miliya612
Created November 2, 2018 11:47
Show Gist options
  • Save miliya612/5423a2d62fcb7dcc19cde59851277841 to your computer and use it in GitHub Desktop.
Save miliya612/5423a2d62fcb7dcc19cde59851277841 to your computer and use it in GitHub Desktop.
Spec: WebAuthn#5

About

summary

  • 基本的なアイディア

    • userに紐づくcredentialはauthenticatorによって管理される
    • WebAuthnのRPはclient platform(browserだっけ?deviceだっけ?)を介してauthenticatorとやり取りをする
  • registration

    • RPはuserの同意のもと、browserにリクエストを行う
    • 自分(RP)が認証に用いる新規credentialを生成する
  • registraion flow(https://www.w3.org/TR/webauthn/images/webauthn-registration-flow-01.svg)

    1. RP Server -> RP Client PublicKeyCredentialCreateOptions
      • challenge
      • user info
      • relying party info
    2. RP Client -> Browser
      • WebAuthnAPI REQUEST
    3. Browser -> Authenticator
      • relying party id
      • user info
      • relying party info
      • clientDataHash
    4. Anthenticator
      • user verification
      • new keypair
      • attestation
    5. Authenticator -> Browser attestationObject
      • new public key
      • credential id
      • attestation
    6. Browser -> RP Client
      • WebAuthnAPI RESPONSE
    7. RP Client -> RP Server AuthenticatorAttestationResponse
      • clientData
      • attestationObject
    8. RP Server
      • server validation
  • authentication

    • RP(のclient sideに仕込まれた多分java)scriptが、自RP内に既存のcredentialを使用してauthenticationを実行する
    • authentication実行のため、RP(略)scriptがuserに許可を求める(?)
  • authentication flow(https://www.w3.org/TR/webauthn/images/webauthn-authentication-flow-01.svg)

    1. RP Server -> RP Client PublicKeyCredentialCreateOptions
      • challenge
    2. RP Client -> Browser
      • WebAuthnAPI
    3. Browser -> Authenticator
      • relying party id
      • clientDataHash
    4. Authenticator
      • user verification
      • create assertion
    5. Authenticator -> Browser
      • authenticatorData
      • signature
    6. Browser -> RP Client
      • WebAuthnAPI
    7. RP Client -> RP Server AuthenticatorAssertionResponse
      • clientDataJSON
      • authenticatorData
      • signature
    8. RP Server
      • server validation
  • registrationとauthenticationはuserの代理となるclient PFによって仲介され、authenticatorの中で行われる

  • RP scriptはcredential自体へのアクセスは行わず、object形式のデータとしてcredentialに関する情報を得るに限られる

  • authenticatorはregistration, authenticationで使用されるIFに加えて、以下のものを提供することがある

    • credentialなどを管理するUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment