Last active
April 15, 2019 03:29
-
-
Save daisukenishino2/d50bfcfa415902abfdee0e27ed48a715 to your computer and use it in GitHub Desktop.
fido2-net-lib https://github.com/abergs/fido2-net-lib を分析している (2018/08/29) 。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"status": "ok", | |
"errorMessage": "", | |
"rp": { | |
"id": "localhost", | |
"name": "Fido2 test" | |
}, | |
"user": { | |
"name": "aaa@example.com", | |
"id": "YWFhQGV4YW1wbGUuY29t", | |
"displayName": "Display aaa@example.com" | |
}, | |
"challenge": "8P0YAYk-sxYVM0Xmt7Irow", | |
"pubKeyCredParams": [ | |
{ | |
"type": "public-key", | |
"alg": -7 | |
}, | |
{ | |
"type": "public-key", | |
"alg": -257 | |
} | |
], | |
"timeout": 60000, | |
"attestation": "none", | |
"authenticatorSelection": null, | |
"excludeCredentials": [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "4F-FJ5PWB2MsnBYC9qBOo9DjSIyHPGeoyNJlR1Cc3LOyOygSu0HGKdvB5ln-7hIP8Cyo6s5krsKkiDxNaRu3BA", | |
"rawId": "4F-FJ5PWB2MsnBYC9qBOo9DjSIyHPGeoyNJlR1Cc3LOyOygSu0HGKdvB5ln-7hIP8Cyo6s5krsKkiDxNaRu3BA", | |
"type": "public-key", | |
"response": { | |
"AttestationObject": "o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YVjESZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2NBAAAAAAAAAAAAAAAAAAAAAAAAAAAAQOBfhSeT1gdjLJwWAvagTqPQ40iMhzxnqMjSZUdQnNyzsjsoErtBxinbweZZ_u4SD_AsqOrOZK7CpIg8TWkbtwSlAQIDJiABIVggjXJiXxbIKez0-7iKeN9BLn9WSRUjGuBZT2KAzxuzvdYiWCAgv0KMHPO69DiXQntyKfueL2Fb9DpaEQrene0hZoaTsQ", | |
"clientDataJson": "eyJjaGFsbGVuZ2UiOiI4UDBZQVlrLXN4WVZNMFhtdDdJcm93Iiwib3JpZ2luIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NDQzMjkiLCJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIn0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"status": "ok", | |
"errorMessage": "", | |
"result": { | |
"publicKey": "pQECAyYgASFYII1yYl8WyCns9Pu4injfQS5_VkkVIxrgWU9igM8bs73WIlggIL9CjBzzuvQ4l0J7cin7ni9hW_Q6WhEK3p3tIWaGk7E", | |
"credentialId": "4F-FJ5PWB2MsnBYC9qBOo9DjSIyHPGeoyNJlR1Cc3LOyOygSu0HGKdvB5ln-7hIP8Cyo6s5krsKkiDxNaRu3BA", | |
"user": { | |
"name": "aaa@example.com", | |
"id": "YWFhQGV4YW1wbGUuY29t", | |
"displayName": "Display aaa@example.com" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aaa@example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"status": "ok", | |
"errorMessage": "", | |
"challenge": "TDmWbzrQ9gIHkbs6dw78mA", | |
"timeout": 60000, | |
"rpId": "localhost", | |
"allowCredentials": [ | |
{ | |
"type": "public-key", | |
"id": "4F-FJ5PWB2MsnBYC9qBOo9DjSIyHPGeoyNJlR1Cc3LOyOygSu0HGKdvB5ln-7hIP8Cyo6s5krsKkiDxNaRu3BA", | |
"transports": [] | |
} | |
], | |
"userVerification": "discouraged" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "4F-FJ5PWB2MsnBYC9qBOo9DjSIyHPGeoyNJlR1Cc3LOyOygSu0HGKdvB5ln-7hIP8Cyo6s5krsKkiDxNaRu3BA", | |
"rawId": "4F-FJ5PWB2MsnBYC9qBOo9DjSIyHPGeoyNJlR1Cc3LOyOygSu0HGKdvB5ln-7hIP8Cyo6s5krsKkiDxNaRu3BA", | |
"type": "public-key", | |
"response": { | |
"authenticatorData": "SZYN5YgOjGh0NBcPZHZgW4_krrmihjLHmVzzuoMdl2MBAAAAEw", | |
"clientDataJson": "eyJjaGFsbGVuZ2UiOiJURG1XYnpyUTlnSUhrYnM2ZHc3OG1BIiwib3JpZ2luIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6NDQzMjkiLCJ0eXBlIjoid2ViYXV0aG4uZ2V0In0", | |
"signature": "MEUCIQDHjPF36rA_5LIXfUs8ZBI-HbQ68YRWa2z3tNVAWWqOPwIgMr_aeefHsqJJrCWkZwYO1h5ciU83dKGlQW8qOcbsJcU" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"CredentialId": "qD7spwzSO7q1W3F7r84aUud9yHq37aufS72jHaeckZfIbHHl9LNNzZwRohJjs9v7MjaiW/FiI/IImg1kZ9lGIQ==", | |
"Counter": 21 | |
} |
認証(Assertion)
assertionOptions WebAPI
- 引数:POST(username)
- 戻り値:navigator.credentials.get()メソッドへの引数を生成して返す。
- JavaScript
- 戻り値の一部のメンバがJavaScriptで以下のように変換される。
Uint8Array.from(atob(string.replace(/-/g, "+").replace(/_/g, "/")), c => c.charCodeAt(0))- challenge
- allowCredentials.id
- navigator.credentials.get()メソッドの引数に渡されて戻り値を受け取る。
- 戻り値の一部のメンバは、JavaScriptで変換される。
- id: 変換無し
- rawId: base64enc
- type: 変換無し
- response
- authenticatorData: base64enc
- clientDataJson: base64enc
- signature: base64enc
- 戻り値の一部のメンバがJavaScriptで以下のように変換される。
makeAssertion WebAPI
- 引数:POST(JSON)
- 処理内容:navigator.credentials.get()メソッドの戻り値の署名を公開鍵で検証して認証する。
- 戻り値:JSONを生成してはいるが、
- JavaScript
戻り値は、そのまま捨てられている。
参考
コミュニティとのやり取り
passwordless-lib/fido2-net-lib#26
W3Cの仕様の分析
- マイクロソフト系技術情報 Wiki
https://techinfoofmicrosofttech.osscons.jp/
2019/03/03
Preview版の再分析
https://gist.github.com/daisukenishino2/f09fb400fa2186aead4b6f8cad59ab38
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
登録(Attestation)
makeCredentialOptions WebAPI
makeCredential WebAPI
戻り値は、そのまま捨てられている。