walt-id / waltid-walletkit

Toolkit for SSI and NFT/SBT wallets
https://docs.walt.id
Apache License 2.0
31 stars 25 forks source link

ESSIF Authorization API flow generated an error (No argument provided for a required parameter) #96

Closed sylfax closed 1 year ago

sylfax commented 1 year ago

Hello,

I'm using the latest version. I want to generate a DID for an issuer for EBSI. Now I have the following error in the following step (the previous steps work fine:

waltid-walletkit config --as-issuer essif auth-api --did did:ebsi:z22Bp8QEiHPPuPtbEyj45zby

The error is the following: `walt.id SSI Kit 1.13.0-SNAPSHOT (running on Java 17.0.3+6-LTS) [main] DEBUG id.walt.services.WaltIdServices - Creating dir-structure at: data

[main] INFO id.walt.webwallet.backend.cli.ConfigCmd - Running in context of: Issuer EBSI Authentication API flow for DID did:ebsi:z22Bp8QEiHPPuPtbEyj45zby running...

[main] DEBUG id.walt.services.ecosystems.essif.EssifClient - ESSIF Authorization API flow started [main] DEBUG id.walt.services.ecosystems.essif.userwallet.UserWalletService - Loading Verifiable Authorization from HKV Store. Exception in thread "main" com.beust.klaxon.KlaxonException: Unable to instantiate EbsiVAWrapper:No argument provided for a required parameter: parameter #0 verifiableCredential of fun <init>(id.walt.services.ecosystems.essif.EbsiVa, id.walt.credentials.w3c.W3CProof?): id.walt.services.ecosystems.essif.EbsiVAWrapper No argument provided for a required parameter: parameter #0 verifiableCredential of fun <init>(id.walt.services.ecosystems.essif.EbsiVa, id.walt.credentials.w3c.W3CProof?): id.walt.services.ecosystems.essif.EbsiVAWrapper

at com.beust.klaxon.JsonObjectConverter.initIntoUserClass(JsonObjectConverter.kt:115)
at com.beust.klaxon.JsonObjectConverter.fromJson(JsonObjectConverter.kt:30)
at com.beust.klaxon.DefaultConverter.fromJsonObject(DefaultConverter.kt:223)
at com.beust.klaxon.DefaultConverter.fromJson(DefaultConverter.kt:40)
at com.beust.klaxon.Klaxon.fromJsonObject(Klaxon.kt:296)
at id.walt.services.ecosystems.essif.userwallet.UserWalletService.createVerifiedClaims(UserWalletService.kt:579)
at id.walt.services.ecosystems.essif.userwallet.UserWalletService.siopSession(UserWalletService.kt:217)
at id.walt.services.ecosystems.essif.userwallet.UserWalletService.requestAccessToken(UserWalletService.kt:118)
at id.walt.services.ecosystems.essif.EssifClient.authApi(EssifClient.kt:236)
at id.walt.cli.EssifAuthCommand.run(EssifCommand.kt:66)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:198)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:211)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:18)
at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:400)
at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:397)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:415)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:440)
at id.walt.MainKt$main$1.invokeSuspend(Main.kt:101)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at id.walt.MainKt.main(Main.kt:26)` 
waltkb commented 1 year ago

Just tested with SSI Kit:

ssikit did create -m ebsi
Creating did:ebsi (key: c6150b22560449f69b69fb9042fda868)
DID created: did:ebsi:zqbpbMhyHg95cDyyuWQ8Rui
ssikit essif onboard --did did:ebsi:zqbpbMhyHg95cDyyuWQ8Rui bearer.txt
ESSIF onboarding for DID did:ebsi:zqbpbMhyHg95cDyyuWQ8Rui running...
ESSIF onboarding for DID did:ebsi:zqbpbMhyHg95cDyyuWQ8Rui was performed successfully.
ssikit essif auth-api --did did:ebsi:zqbpbMhyHg95cDyyuWQ8Rui
EBSI Authentication API flow for DID did:ebsi:zqbpbMhyHg95cDyyuWQ8Rui running...
EBSI Authentication API flow for DID did:ebsi:zqbpbMhyHg95cDyyuWQ8Rui was performed successfully.
waltkb commented 1 year ago

Are you possibly using an old version of the Wallet Kit?

waltkb commented 1 year ago

Okay, it seems like this happens when EBSI returns:

{"title":"Unauthorized","status":401,"type":"about:blank","detail":"\"exp\" claim timestamp check failed"}

I will add an expiration check for the bearer token and an appropriate error message.

waltkb commented 1 year ago

There is now both a check for invalid Verifiable Authorizations (like in your place it will still be stored) & for expired bearer tokens at the onboarding step.

sylfax commented 1 year ago

Thanks!

It's works perfectly!

waltkb commented 1 year ago

Thanks!

It's works perfectly!

Great to hear!