WalletCLI is a testing tool for checking the OIDC4VP flow.
Referring to the sequence diagram for OIDC for SIOP presentation it simulates the Wallet behaviour
starting from the step "Scan QR code and loads wallet" (#15) until checking the post authorization response status (#31).
Prerequisites
During the processing of OIDC4VP flow Wallet has to be enriched with the signed credentials to be able to resolve a Presentation Definition query.
Please refer to the interface "VCProvider" that developer may use to provide a different credentials source.
For now there is only one implementation called "vcs" that by default
interacts with the Local VCS API, that can be launched using BDD docker-compose.yml file.
Therefore, to be able to use vcs VCProvider with default VCS local config, developer should launch VCS environment in advance.
CLI arguments
The next CLI arguments are supported:
-qrCodePath
- path to the file with QR code. Only *.gif
, *.jpg
and *.png
formats supported.
-oidc4vpAuthorizationRequest
- OIDC4VP authorization request string. (e.g. openid-vc://?request_uri=http://example.com/request-object/637b99d5a2a6e0b3fc7d7192
).
-vcProvider
- VC provider implementation. (Default: vcs
).
-vcIssuerURL
- Issuer URL (Default: https://localhost:4455/issuer/profiles/i_myprofile_ud_es256_jwt/credentials/issue
).
-vcFormat
- format of the VC. Supported formats are jwt_vc
and ldp_vc
. (Default: jwt_vc
).
Note:
`qrCodePath` or `oidc4vpAuthorizationRequest` must be supplied.
Usage
# build
go build -o walletcli ./cli.go
#run
./walletcli -qrCodePath=testdata/example/qrcode.png
Output example
$ ./walletcli -qrCodePath=qrcode.png
Start OIDC4VP flow
AuthorizationRequest: openid-vc://?request_uri=http://vc-rest-echo.trustbloc.local:8075/request-object/637ba60ca2a6e0b3fc7d71a2
Creating wallet
Issuing credentials
Saving credentials to wallet
4 credentials were saved to wallet
Fetching request object
Resolving request object
Querying VC from wallet
Creating authorized response
Sending authorized response
Credentials shared with verifier