🔑

Web based EU digital identity wallet leveraging FIDO ためしてみた

2023/12/16に公開

Digital Identity 技術勉強会 #iddance Advent Calendar 2023 16 日目の記事です。

https://qiita.com/advent-calendar/2023/iddance

本投稿では、以下の "The first working demo of a web based EU digital identity wallet leveraging FIDO open authentication standards"[1] を試した際の動作を備忘録として記録します。

https://www.yubico.com/blog/the-first-working-demo-of-a-web-based-eu-digital-identity-wallet-leveraging-fido-open-authentication-standards/

はじめに

"The first working demo of a web based EU digital identity wallet leveraging FIDO open authentication standards"[1:1]では FIDO2 (WebAuthn)[2] や Verifiable Credentials Data Model[3] といった技術仕様を扱います。
こちらの記事を読むうえで最低限 Verifiable Credentials Data Model のエコシステムについて理解しておくと良さそうです。

また、Verifiable Credentials Data Model における credential repository についても事前に理解しておくと良さそうでした。

holder
A role an entity might perform by possessing one or more verifiable credentials and generating verifiable presentations from them. A holder is often, but not always, a subject of the verifiable credentials they are holding. Holders store their credentials in credential repositories.
...
repository
A program, such as a storage vault or personal verifiable credential wallet, that stores and protects access to holders' verifiable credentials.
(引用元: https://www.w3.org/TR/vc-data-model-2.0/#terminology)

動作確認

とりあえず試してみます。
ソースコードは GitHub リポジトリも公開されており[4]、自分でホストすることもできるようですが、Firebase を前提とした実装であり設定値もおおくて面倒だったのでデモ用に用意された以下の環境を使用しました。

デモ環境: https://demo.wwwallet.org

Holder

デモ環境にアクセスします。
"Sign Up" または "Login" ができるので、まずは "Sign Up" を実施します。ユーザー名を入力し、[Sign up with passkey] を押下します。

ここで WebAuthentication API が呼び出されます。今回はデモ動画の通り YubiKey を認証器として使用しました。

User Verification が要求されるため PIN も併せて入力することで登録を完了することができました。YubiKey の PIN の詳細については Yubico 社の記事をご確認ください[5]
登録が完了したことが確認できたため、引き続き [Continue] を押下して認証を行います。

先ほど登録した認証器 (YubiKey) を使用して認証を行います。

認証が完了すると以下のような画面が表示されます。これで Wallet へのログインが完了した状態となります。

Issuer -> Holder

Issuer から Credential を発行してもらいます。
画面の [Add Credentials] を押下し、"VID Issuer" という Issuer を選択します。

Issuer の画面に遷移するため自動で入力済みのユーザー名およびパスワードを使用してログインします。

発行するクレデンシャルの確認が要求されます。今回は図のようなクレデンシャルが発行できるようです。

発行が完了した場合、Wallet の画面にて発行されたクレデンシャルを表示できるようになります。

ちなみに、今回発行されたクレデンシャルのフォーマットについては次の通りでした。

{
  "@context": [],
  "type": [
    "VerifiableCredential",
    "VerifiableAttestation",
    "VerifiableId",
    "urn:credential:vid"
  ],
  "id": "032429484252432",
  "issuer": {
    "id": "did:key:z2dmzD81cgPx8Vki7JbuuMmFYrWPgYoytykUZ3eyqht1j9KbqRoRQ4yeRa2F6m4aqkpBuH9QfgNYJ7x9QRe31JbE7qCKRLPE1at1z837T464MzMkshXMwiS5n6RFuASF8zEmgdSpCP9HyUA3RRdGmKvs5TMW8n24HtYY2rgmjU9qaT7MoJ",
    "name": "did:key:z2dmzD81cgPx8Vki7JbuuMmFYrWPgYoytykUZ3eyqht1j9KbqRoRQ4yeRa2F6m4aqkpBuH9QfgNYJ7x9QRe31JbE7qCKRLPE1at1z837T464MzMkshXMwiS5n6RFuASF8zEmgdSpCP9HyUA3RRdGmKvs5TMW8n24HtYY2rgmjU9qaT7MoJ",
    "iconUrl": "https://vid-issuer.ediplomas.gr/images/uoa.svg",
    "image": "https://vid-issuer.ediplomas.gr/images/uoa.svg",
    "logoUrl": "https://vid-issuer.ediplomas.gr/images/uoa.svg"
  },
  "audience": "",
  "issuanceDate": "2023-12-14T13:33:29.000Z",
  "issued": "2023-12-14T13:33:29.000Z",
  "validFrom": "2023-12-14T13:33:29.000Z",
  "credentialSubject": {
    "familyName": "Doe",
    "firstName": "John",
    "id": "did:key:z2dmzD81cgPx8Vki7JbuuMmFYrWPgYoytykUZ3eyqht1j9KbscxG3Byreanti2wfxq4hMTee5hJNuJ84NbMYT277aq7DraKJ3bW8JM9xP3H8gMAYFqDzB6aY1eCGs1Vo5vyi5HydkD7TBvV1xi5VRFsLUcdPYEWQBxFjPAQVdPGQVtnh4x",
    "personalIdentifier": "032429484252432",
    "dateOfBirth": "18-5-1990"
  },
  "credentialSchema": {
    "id": "https://api-pilot.ebsi.eu/trusted-schemas-registry/v2/schemas/z8Y6JJnebU2UuQQNc2R8GYqkEiAMj3Hd861rQhsoNWxsM",
    "type": "FullJsonSchemaValidator2021"
  },
  "expirationDate": "2024-12-13T19:33:29.000Z"
}

Holder -> Verifier (Issuer)

先ほど発行したクレデンシャルを使用して新しいクレデンシャルの発行を行います。

再び画面の [Add Credentials] を押下し、"University of Athens Issuer" という Issuer を選択します。

認証方法が選択できるため、ここでは [Authentication with Verifiable ID] を選択します。

先ほど発行しておいたクレデンシャルを選択します。

発行するクレデンシャルの確認が要求されます。今回は図のようなクレデンシャルが発行できるようです。

発行が完了した場合、Wallet の画面にて発行されたクレデンシャルを表示できるようになります。

ちなみに、今回発行されたクレデンシャルのフォーマットについては次の通りでした。

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1"
  ],
  "type": [
    "VerifiableCredential",
    "VerifiableAttestation",
    "Bachelor",
    "urn:credential:ediplomas:blueprint:46"
  ],
  "id": "1",
  "issuer": {
    "id": "did:key:z6MkwcjHDtnV8hjYbJHL9dDDiVmhwGcZdid4sp3m46VB4HVZ",
    "name": "did:key:z6MkwcjHDtnV8hjYbJHL9dDDiVmhwGcZdid4sp3m46VB4HVZ",
    "iconUrl": "https://diploma-issuer.ediplomas.gr/images/uoa.svg",
    "image": "https://diploma-issuer.ediplomas.gr/images/uoa.svg",
    "logoUrl": "https://diploma-issuer.ediplomas.gr/images/uoa.svg"
  },
  "audience": "",
  "issuanceDate": "2023-12-14T13:47:26.000Z",
  "issued": "2023-12-14T13:47:26.000Z",
  "validFrom": "2023-12-14T13:47:26.000Z",
  "credentialSubject": {
    "id": "1",
    "firstName": "John",
    "familyName": "Doe",
    "grade": "8.1",
    "eqfLevel": "6",
    "diplomaTitle": "Informatics and Telecommunications",
    "certificateId": "1",
    "dateOfBirth": "1990-07-01",
    "completionDate": "2020-09-01",
    "awardingDate": "2020-06-01",
    "achievement": {
      "name": "University Degree Credential",
      "description": "A Europass Diploma issued by the University of Athens",
      "type": "Bachelor",
      "image": "https://diploma-issuer.ediplomas.gr/images/EuropassUoaCard.png"
    }
  },
  "expirationDate": "2024-12-13T19:47:26.000Z",
  "name": "University Degree Credential",
  "description": "A Europass Diploma issued by the University of Athens",
  "credentialBranding": {
    "backgroundColor": "#8ebeeb",
    "textColor": "#ffffff"
  }
}

所感

現時点で WebAuthentication API の呼び出しは、Credential Repository (Wallet) へのログイン時だけのようでした。
以前より IIW などで以下のような DID Auth の一部で WebAuthn を使用するような方法が検討されていたと記憶していますが、当該ブログで紹介されている方法はそれとは異なるものに見えました。

ブログ上に以下のような記載があり、Identity wallet の保護を目的として FIDO が使用されているように見受けられます。

Apart from user authentication, FIDO security keys can play a crucial role in securing identity wallets. A wallet’s contents can be encrypted and decrypted using cryptographic keys derived from secrets bound to the secure hardware of a FIDO security key. Additional security keys can be added to protect an individual’s wallet as a backup, or users sharing an organizational wallet can use their own FIDO security key to access that wallet.
(引用元: https://www.yubico.com/blog/the-first-working-demo-of-a-web-based-eu-digital-identity-wallet-leveraging-fido-open-authentication-standards/)

UX については web based digital identity wallet ということで、目的は異なりますが Credential Handler API (CHAPI)[6] を使用する場合と似ている部分が多いのかなと思いました。


Verifiable Credentials Ecosystem[7]

例えば、CHAPI ではブラウザ上での Digital Identity Wallet の選択を可能にしますが、Wallet を選択したのちに WebAuthn を使用して Identity Wallet にログインするといったことが実現できる感じでしょうか。
(CHAPI については以前概要をまとめた発表資料を作成したので興味があれば確認してみてください[8]。)

まとめ

本投稿では "The first working demo of a web based EU digital identity wallet leveraging FIDO open authentication standards"[1:2] という記事で紹介されているデモを試してみました。
こちらのデモは Holder->Credential Repository において FIDO2 による認証が使用できるものに見受けられました。一方で Issuer->Holder や Holder->Verifier などで FIDO2 を使用するものではないように見受けられました。


The first working demo of a web based EU digital identity wallet leveraging FIDO open authentication standards[1:3]

当該ブログでは以下のような Next steps が記載されており、今後もユースケースの拡大が続けられるようです。もし何か更新があればまたチェックしてみたいですね。

Next steps
In a few months, we plan to release an alpha version of the wwWallet software compatible with the latest version of the EU wallet Architecture Reference Framework (ARF) and we will be able to support at least one the following use-cases:

1 The EU social security card
2 Banking applications requiring multiple user control
3 Use-cases involving power-of-attorney
4 Educational credentials
(引用元: https://www.yubico.com/blog/the-first-working-demo-of-a-web-based-eu-digital-identity-wallet-leveraging-fido-open-authentication-standards/)

ではまた!

脚注
  1. The first working demo of a web based EU digital identity wallet leveraging FIDO open authentication standards | https://www.yubico.com/blog/the-first-working-demo-of-a-web-based-eu-digital-identity-wallet-leveraging-fido-open-authentication-standards/ ↩︎ ↩︎ ↩︎ ↩︎

  2. Verifiable Credentials Data Model v2.0 | https://www.w3.org/TR/vc-data-model-2.0/ ↩︎

  3. Web Authentication: An API for accessing Public Key Credentials Level 3 | https://www.w3.org/TR/webauthn-3/ ↩︎

  4. wwWallet https://github.com/wwWallet/wallet-frontend ↩︎

  5. Understanding YubiKey PINs https://support.yubico.com/hc/en-us/articles/4402836718866-Understanding-YubiKey-PINs ↩︎

  6. Credential Handler API 1.0 https://w3c-ccg.github.io/credential-handler-api/ ↩︎

  7. 101 Session: Verifiable Credential Handler (CHAPI) and DIDComm https://iiw.idcommons.net/101_Session:Verifiable_Credential_Handler(CHAPI)_and_DIDComm ↩︎

  8. Credential Handler API https://speakerdeck.com/kg0r0/credential-handler-api ↩︎

GitHubで編集を提案

Discussion