Git Product home page Git Product logo

openid4vc-playground's Introduction


screenshot-demo

Animo OpenID4VC Playground

License

Tip

Check out the demo at https://openid4vc.animo.id

โœจ Hi there!

Welcome to the repository of Animo's OpenID4VC Playground. This interactive playground demonstrates the use of OpenID4VC with different credential formats (such as SD-JWT VCs). This demo is built using Aries Framework Javascript (AFJ). AFJ is a framework written in TypeScript for building decentralized identity services.

๐Ÿ› ๏ธ Usage

Prerequisites

  • NodeJS v18.X.X - Other versions may work, not tested
  • pnpm
  • Git - You probably already have this

๐Ÿ–ฅ App

Copy the .env.example file to a .env.local file and set the environment variables. This is not needed for development.

cd app
cp .env.example .env
Variable Description
NEXT_PUBLIC_API_URL Used in the frontend application to connect with the backend. Default to http://localhost:3001 for development.

๐ŸŽ›๏ธ Agent

Copy the .env.example file to a .env.local file and set the environment variables. This is not needed for development.

cd agent
cp .env.example .env
Variable Description
AGENT_HOST Used in the backend application for the agent. The url at which the server will be available.
AGENT_WALLET_KEY Used in the backend application for the agent. Should be secure and kept private.

Important

The issuer will use did:web for issuing credentials, but this requires https to be used. When developing locally it is recommend to use ngrok (npx ngrok http 3001) and use that url as the AGENT_HOST variable. Make sure to also set the NEXT_PUBLIC_API_URL variable in the app to the ngrok.

We may add issuance using did:key in development if the host url does not start with https.

Install Dependencies

pnpm install

Development

Open three terminal windows, and then run the following:

npx ngrok http 3001

Copy the https url from the ngrok command and set that as the AGENT_HOST

cd agent
AGENT_HOST=https://30f9-58-136-114-148.ngrok-free.app pnpm dev
cd app
pnpm dev

๐Ÿ–‡๏ธ How To Contribute

You're welcome to contribute to this playground. Please make sure to open an issue first!

This playground is open source and you're more than welcome to customize and use it to create your own OpenID4VC Playground. If you do, an attribution to Animo would be very much appreciated!

openid4vc-playground's People

Contributors

timoglastra avatar warren-gallagher avatar y12studio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

openid4vc-playground's Issues

Add issuer did method selector

Can be maybe next to or below the credential type selector.

The did method selector should fetch the supported did methods from the server

Should also add new endpoints to return the supported did methods

Unable to resolve the credential uri

Hello @TimoGlastra

I have created an offer using OpenID. However, when I attempted to receive the offer through [https://openid4vc.animo.id/](OpenId4vc Animo), I received an error message as seen in the screenshots below:

Screenshot 2024-03-09 at 11 11 54 PM
Screenshot 2024-03-09 at 11 12 03 PM

I am uncertain whether the agent will handle the configuration or if it needs to be done manually. Could you please clarify this for me?

Allow to select holder binding in receive tab

Based on what the issuer supports (issuer metadata) we should allow the holder to select which key binding material to use.

For .e.g. SD-JWT-VC we want to support both did binding and jwk binding

Issue to Paradym wallet fails

Agent gets a NOT FOUND error when attempt to process issuance offer from Paradym Wallet.
Issuer page screen shot attached.

Agent console log:
pnpm dev
Debugger attached.

agent@ dev /Users/wgallagher/dev/aq/openid4vc-playground/agent
tsx watch -r dotenv/config src/server.ts dotenv_config_path=.env.development

Debugger attached.
Debugger attached.
WARN: The '@credo-ts/cheqd' module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.
WARN: The '@credo-ts/openid4vc' Issuer module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.
WARN: The '@credo-ts/openid4vc' Holder module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.
WARN: The '@credo-ts/openid4vc' Verifier module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.
WARN: The 'DifPresentationExchangeModule' module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.
WARN: The 'SdJwtVc' module is experimental and could have unexpected breaking changes. When using this module, make sure to use strict versions for all @credo-ts packages.
INFO: Creating agent with config {
"agentConfig": {
"label": "OpenID4VC Playground",
"logger": 1,
"walletConfig": {
"id": "openid4vc-playground",
"key": "[]",
"storage": {}
},
"agentDependencies": true
}
}
INFO: Initializing wallet 'openid4vc-playground' {
"id": "openid4vc-playground",
"key": "[
]",
"storage": {}
}
DEBUG: Wallet 'openid4vc-playground' not found
DEBUG: Creating wallet 'openid4vc-playground
DEBUG: Successfully created wallet 'openid4vc-playground'
DEBUG: Setting current agent storage version to 0.5
TRACE: Storage upgrade record does not exist yet. Creating.
INFO: Agent storage is up to date.
DEBUG: Mediator routing record not loaded yet, retrieving from storage
DEBUG: Mediator routing record does not exist yet, creating routing keys and record
DEBUG: resolving didUrl did:key:z6MkpRSYe1WHRSmqsTheBa6rdTjyG5hJwttTcEhvgg1Kapbv
DEBUG: resolving didUrl did:key:zDnaefEzJWXWBSGXXjqYc61JWWPu7saR2EL9d1qyvAy8eKvrx
DEBUG: resolving didUrl did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImxCMlV1ZXZPVE02bEZ1NE43NFVOY09RWFR1aXJOa3hQU0NnNUUtdTBHZzAifQ
DEBUG: resolving didUrl did:jwk:eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwieCI6IjNBOVY4eW5xUmNWakFEcWxmcFo5WDhtd2JldzBUdVFsZEhfUU9wa2Fkc1UiLCJ5IjoiYWYyVkh5TzRNemlFaFVlQmZvZVpWQk0tV1R5WmwtRGlNQzZfZC1zUzRNSSJ9
INFO: app listening on port 3001
WARN: [OID4VCI] Sending error response: {"error":"not_found","error_description":"Credential offer not found"} {
"error": "Credential offer not found"
}
Screenshot 2024-04-15 at 12 28 30โ€ฏPM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.