ONCE SDI Project
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Requesting eID Data from the ONCE Wallet ###### tags: `documentation` A ONCE compliant Wallet will allows users to manage / share different types of verifiable (attested) data. At this stage, the main types / categories of data are: - [W3C Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) — Signed data structures which can be used to encode any "arbitrary" / use case specific signed attestations. - Data persisted on the eID card — the complete list of attributes which can be requested is defined [here](https://www.ausweisapp.bund.de/sdk/messages.html#values). Service providers can request both eID data and Verifiable Credentials from a ONCE Compliant Wallet. This document will outline **the interfaces, as well as data structures relevant to exchanging eID data**. ## 1. eID interaction -- core components In the example use case -- *"a service provider (e.g. a car rental service) would like to request some specific eID data from a potential user as part of it's service offering"*. The following core components / roles would be involved: 1. Service Provider - this role is usually taken by a relying party interested in requesting / consuming various types of verifiable data provided by the ONCE Wallet. The requested data is usually required in order to provide a specific service. The back end service, implementing logic specific to the business case, can interact with the ID Gateway component in order to request eID data from a ONCE compliant Wallet. 2. ONCE Wallet - A mobile application, allowing users to securely share eID data (as well as W3C Verifiable Credentials) with various services, as well as manage their digital identity and associated documents. 1. Internally, the ONCE compliant Wallet will need to integrate an eID Client to support the described interactions (in the case of the Jolocom SmartWallet, this is the [AusweisApp2 SDK](https://www.ausweisapp.bund.de/sdk/)). 3. ID Gateway - This component simplifies the integration between the Service Provider component and the (potentially multiple) eID Service(s) / infrastructure. 4. eID Service - As a hard- and software component, the eID-Server implements the server-side eCard-API-Framework as specified in [TR-03112] and establishes communication to the client-side eCard-API-Framework implementation (eID-Client). For further documentation / illustrations on how the various components interact, please refer to section [2 Infrastructure and general regulations](https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/TechnischeRichtlinien/TR03130/TR-03130_TR-eID-Server_Part1.pdf;jsessionid=0E0CA28CDB627F32E452B6BF3C020DB8.internet081?__blob=publicationFile&v=3). The following diagram describes (in detail) the individual steps which need to take place as part of a data exchange interaction: ![Interaction](https://ptuml.hackmd.io/svg/TLJRRjf047ttLunu0YcckVG9HKWK4B6Q4jSswYFQs0EiOg_TtNK8_VhEh4rYt1G9WNRkvvmPaTfIms1ZK0z06DZ4oyYhXBOobPLG5WPFw_aIVeayH-iyPc5uwJ2hpH6bcLNLBSIBxyw9VY-TC5X0AdJchCjWSMcDKR_A527KvQlCsbR2-DA9Cgo4nQCuENEmMFrJmcyJDOrkakKwyJnHsrBLnJDgp-Fn_6aOJo1GqafA1znP9gm0ZRzhD1QaigX5QcMfO8ZZ_HYUJv3cCdsHQWy38_UAV0OZBuplVNzAVKmWjjG9F5MeADkyL0fJ2mjfql8LzOay_IdXHdu7eH5icfGlg3OwXs4lPbRR0oeQIhZwKTFJ28xI7k3eM83XpuZyCxo23B62HwbUHfugQHQknWHTEGA0Fia1eSCW70WOMuBLGfb2Mg1gtNROH2yKFNuFRyt-3qmFGabJW3I0RrKkfCACe81lSG19v0AkxsvklqAjClvtTps660dYDr5KES8pvkLnx25PkLrlhykwuc8-4P-YCUqBKs8iZNO3mnOO1eCSx_qfqynA6daqg3-bnmcaHGRHPhqboX-6vt6Ynv7dGbgELZH-Q-FGUz-55cRFIddeFytdopZUHi7g8Obxu9wnPQvABVyqLAL8MjmnSGY29dIQsadCC_CniIioPHLEM1w4uGd4_zBq1kIMmgJNPx2cNCbsFeiM5ya9qAAoKDDUCwcLHaEoWdOBpxZG8ZQu62jiRNgvQNkMqJOCrb_ci_LdsNTqEZhcJg_nCdaFxDRgo1iRJPCNmzDd_lOSrcpnn5d2sLDCoY-AMhKByWcHCDIOIKsQSGhue8wyhkYcd6NThZksJF5UEeZQ5VYuDYv2DAl2H9QxJfiTDVCK_7L8ECNDQUUWqqrZQY2C3-MHu_ZiKKacoXqK5nYrCGr4bphZpU-U7gOlo1XKUu96tJqhvvPgLtf_0G00) ## 2. Example interaction The interaction illustrated above can be split in the following three main parts: 1. Generating / sharing the request for eID data — The service provider interacts with the ID-Gateway component (step 2) in order to generate a request for eID data. This step should result in a `tcTokenUrl`. As soon as the URL is generated, it can be shared with the ONCE Wallet, e.g. by encoding it as a QR code (step 3 on the diagram). 2. Processing the request — The ONCE Wallet passess the received `tcTokenUrl` to the integrated eID client (i.e. the [AusweisApp SDK](https://www.ausweisapp.bund.de/sdk/)). The eID client sends a request to the received URL (as described in [section 3.1.1. in TR-03130](https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/TechnischeRichtlinien/TR03130/TR-03130_TR-eID-Server_Part1.pdf;jsessionid=0E0CA28CDB627F32E452B6BF3C020DB8.internet081?__blob=publicationFile&v=3)), 3. Retrieving the requested data — Once the request has been successfully processed by the ONCE compliant Wallet, the Service Provider is notified by the ID-Gateway component that the requested data is available. The following sections will provide more detail on the relevant steps. ### 2.1 Generating the request for data The service provider can generate an [OpenID Authentication Request](https://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint) (which is the `tcTokenUrl`) as follows: `https://{ID_gateway_authorization_endpoint}?response_type=code&redirect_uri={service_provider_redirect_uri}&state={state_value}&nonce={nonce_value}&client_id={client_id_value}&acr_values=integrated&scope=openid` The `redirect_uri` of the service provider is given to the ID Gateway during registration process. The `scope` is a space seperated array of requested attributes, must contain openid, may contain other values. The `acr_values` must be `integrated`. To get the url of the authorization endpoint and the names of valid scopes, see the discovery endpoint of the ID Gateway `{ID_gateway_url}/.well-known/openid-configuration`. For an example see [here](https://servicekonto.test.governikus-eid.de/AutentIDConnect/npa/.well-known/openid-configuration). An example resulting `tcTokenUrl` would be: ``` https://test.governikus-eid.de/Autent-DemoApplication/RequestServlet?provider=demo_epa_20&redirect=true ``` *Extracted from [the documentation](https://www.ausweisapp.bund.de/sdk/commands.html#run-auth).* ### 2.2 Sharing the TC Token URL to the ONCE Wallet As briefly mentioned previously, the resulting URI can be communicated to a ONCE compliant Wallet via one of the two supported interfaces -- QR codes or Deep Links. Regardless of the selected interface, the requesting party first needs to encode the `tcTokenUrl` as follows: ``` https://jolocom.app.link/eID?tcTokenURL={utlEncode(tokenUrl)} ``` >Example implementation for the encodeUrl function for JavaScript: https://www.w3schools.com/jsref/jsrefencodeuricomponent.asp. The original `tcTokenUrl` value generated in section 1 needs to be URL encoded (as per [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1)) before it can be appended as a query argument to the URI above. The final resulting URI would look as follows: ``` https://jolocom.app.link/eID?tcTokenURL=https%3A%2F%2Ftest.governikus-eid.de%2FAutent-DemoApplication%2FRequestServlet%3Fprovider%3Ddemo_epa_20%26redirect%3Dtrue ``` The URL can now be shared with the Wallet via the available interfaces, namely: 1. Deep Linking — The URI generated above can be embedded in a web page or mobile application. Attempting to open the URI will trigger the ONCE compliant Wallet and navigate to the appropriate consent screen. 2. QR Code / camera — The URI shown above can be encoded as a QR Code. The QR code can be rendered on the service provider's page, and scanned by a ONCE Compliant Wallet. Once the QR code is scanned, the Wallet will render the appropriate consent screen / prompt the user to participate in the interaction. In case the ONCE Wallet is not installed on the user's device, invoking or scanning these interaction requests should forward the user to the appropriate application store platform to install the ONCE Compliant wallet. This feature will become available as soon as the ONCE Compliant Wallet, with included eID functionality, is published to the appropriate stores / marketplaces. ### 3. Retrieving the data Once the user consents to the request, and completes the interaction using their ONCE compliant wallet, the embedded eID client will share the requested data with the corresponding eID server (step 19 in the interaction diagram). The service provider can then retrieve the requested data as follows: The service provider sends an [OpenID Connect token request](https://openid.net/specs/openid-connect-core-1_0.html#TokenRequest). It authorizes against the ID Gateway with Basic Authentication, the client secret is given to the client during registration. The service provider receives a token response: ``` { "access_token": "bP9v6[...]", "scope": "openid", "id_token": "eyJhbGciOiJSUzI1NiJ9.[...]", "token_type": "Bearer", "expires_in": 3599 } ``` The `id_token` is a signed jwt which contains the claims: `sub`, `aud`, `auth_time`, `iss`, `exp`, `nonce`, `iat`, `acr`, `amr`. The `amr` value contains the method of authentication: `eid_de` and the `acr` value contains the level of authentication `high`. The jwt must be validated by the service provider. With the `access_token` the service provider can [request the userinfo](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo). The userinfo response contains another signed jwt, which must be validated as well. The body of this jwt contains the eID data and looks like this ``` { "name": "ERIKA MUSTERMANN", "given_name": "ERIKA", "family_name": "MUSTERMANN", "birthdate": "1970-01-01", "address": { "country": "D", "street_address": "MUSTERSTRAẞE 1", "locality": "MUSTERSTADT", "postal_code": "12345" }, "http://www.governikus.de/npa/birth_name": "MUSTERNAME", "http://www.governikus.de/npa/place_of_birth": { "formatted": "MUSTERORT" }, "http://www.governikus.de/npa/place_of_birth_type": "FREE_TEXT", "http://www.governikus.de/npa/address_type": "STRUCTURED", "http://www.governikus.de/npa/nationality": "D", "http://www.governikus.de/npa/restricted_id": [...], "http://www.governikus.de/npa/issuing_state": "D", "http://www.governikus.de/npa/date_of_expiry": "2029-01-01", "http://www.governikus.de/npa/document_type": "ID" "sub": [...], "aud": [...], "iat": 1632466629, "jti": [...], "iss": [...], } ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully