Giter VIP home page Giter VIP logo

eudi-lib-jvm-openid4vci-kt's Introduction

EUDI OpenId4VCI library

โ— Important! Before you proceed, please read the EUDI Wallet Reference Implementation project description

License

Table of contents

Overview

This is a Kotlin library, targeting JVM, that supports the OpenId4VCI (draft 13) protocol. In particular, the library focuses on the wallet's role in the protocol to:

  • Resolve credential issuer metadata
  • Resolve metadata of the authorization server protecting issuance services
  • Resolve a credential offer presented by an issuer service
  • Negotiate authorization of a credential issuance request
  • Submit a credential issuance request

Disclaimer

The released software is an initial development release version:

  • The initial development release is an early endeavor reflecting the efforts of a short timeboxed period, and by no means can be considered as the final product.
  • The initial development release may be changed substantially over time, might introduce new features but also may change or remove existing ones, potentially breaking compatibility with your existing code.
  • The initial development release is limited in functional scope.
  • The initial development release may contain errors or design flaws and other problems that could cause system or other failures and data loss.
  • The initial development release has reduced security, privacy, availability, and reliability standards relative to future releases. This could make the software slower, less reliable, or more vulnerable to attacks than mature software.
  • The initial development release is not yet comprehensively documented.
  • Users of the software must perform sufficient engineering and additional testing in order to properly evaluate their application and determine whether any of the open-sourced components is suitable for use in that application.
  • We strongly recommend to not put this version of the software into production use.
  • Only the latest version of the software will be supported

How to use

Library provides the following main api elements to facilitate consumers of this api with the operations related to verifiable credentials issuance

  • Issuer component: A component that offers all operation required to authorize and submit a credential issuance request.
  • Credential offer resolver: A component that interacts with credential issuer to resolve and validate a credential offer presented by the issuer.
  • Metadata resolvers: Components that interact with credential issuer and its authorization server to obtain and parse their metadata.

Credential Issuance

The process of requesting an issuance has been implemented as a stateful process whose steps are depicted as dedicated states holding the outcome of each step. Depending on the state of the process, specific transitions are allowed to move the process to the next step.

VCI specification defines two flows of issuance;

  • Authorization Code Flow (wallet-initiated flow)
  • Pre-Authorization Code Flow. In this flow, before initiating the flow with the Wallet, the Credential Issuer first conducts the steps required to prepare the Credential issuance.

The following state diagrams sketch each flow's states and their allowed transitions.

---
title: Authorization Code Flow state transision diagram
---
stateDiagram-v2 
    state c_nonce_returned <<choice>>    
    state join_state <<join>>
    [*] --> AuthorizationRequestPrepared: prepareAuthorizationRequest    
    AuthorizationRequestPrepared --> c_nonce_exists: authorizeWithAuthorizationCode
    c_nonce_exists --> c_nonce_returned 
    c_nonce_returned --> AuthorizedRequest.ProofRequired : yes
    c_nonce_returned --> AuthorizedRequest.NoProofRequired : no
    AuthorizedRequest.ProofRequired --> join_state: requestSingle (with proof)
    AuthorizedRequest.ProofRequired --> join_state: requestBatch (with proof)
    AuthorizedRequest.NoProofRequired --> join_state: requestSingle (no proof)
    AuthorizedRequest.NoProofRequired --> join_state: requestBatch (no proof)
    join_state --> SubmittedRequest.InvalidProof
    join_state --> SubmittedRequest.Success
    join_state --> SubmittedRequest.Failed
    
---
title: PreAuthorization Code Flow state transision diagram
---
stateDiagram-v2    
    state c_nonce_returned <<choice>>
    state join_state <<join>>    
    [*] --> c_nonce_exists: authorizeWithPreAuthorizationCode
    c_nonce_exists --> c_nonce_returned 
    c_nonce_returned --> AuthorizedRequest.ProofRequired : yes
    c_nonce_returned --> AuthorizedRequest.NoProofRequired : no     
    AuthorizedRequest.ProofRequired --> join_state: requestSingle (with proof)
    AuthorizedRequest.ProofRequired --> join_state: requestBatch (with proof)
    AuthorizedRequest.NoProofRequired --> join_state: requestSingle (no proof)
    AuthorizedRequest.NoProofRequired --> join_state: requestBatch (no proof)
    join_state --> SubmittedRequest.InvalidProof 
    join_state --> SubmittedRequest.Success
    join_state --> SubmittedRequest.Failed    

Issuer is the component that facilitates the authorization and submission of a credential issuance request (batch or single). It is the main entry point for the functionality provided from the library

Initialize an Issuer

An Issuer component is initialized against a credential offer either resolved from an issuance service credential offer URL or manually constructed. The Issuer interface provides a factory method to construct an issuer component.

import eu.europa.ec.eudi.openid4vci.*

val openId4VCIConfig = OpenId4VCIConfig(
    clientId = "wallet-dev", // the client id of wallet (acting as an OAUTH2 client)
    authFlowRedirectionURI = URI.create("eudi-wallet//auth"), // where the Credential Issuer should redirect after Authorization code flow succeeds
    keyGenerationConfig = KeyGenerationConfig.ecOnly(Curve.P_256), // what kind of ephemeral keys could be generated to encrypt credential issuance response
    credentialResponseEncryptionPolicy = CredentialResponseEncryptionPolicy.SUPPORTED, // policy concerning the wallet's requirements for encryption of credential responses
    dPoPProofSigner = ProofSigner.make(..) // if specified, enables DPoP provided that auth. server supports it  
)
val credentialOffer: CredentialOffer = CredentialOfferRequestResolver().resolve(coUrl).getOrThrow()
val issuer = Issuer.make(openId4VCIConfig, credentialOffer).getOrThrow()

Construction of an Issuer might fail in case there is some incompatibility between credential issuer service's metadata and the configuration OpenId4VCIConfig. Such an incompatibility can exist between the wallet's encryption requirements regarding credential responses and the encryption capabilities/requirements of the credential issuer service.

A resolved CredentialOffer object contains the mandatory elements required for issuance.

  • The issuer's identifier
  • The selected authorization server that will authorize the issuance
  • The specific credentials that will be requested

Authorize request via Authorization Code Flow

Given an issuer that is initialized with a specific credential offer, use Authorization Code Flow to authorize an issuance request.

import eu.europa.ec.eudi.openid4vci.*

with(issuer) {
    val preparedAuthorizationRequest = prepareAuthorizationRequest().getOrThrow()
    val authorizationCode: String = ... // using url preparedAuthorizationRequest.authorizationCodeURL authenticate via front-channel on authorization server and retrieve authorization code 
    val authorizedRequest =
        preparedAuthorizationRequest.authorizeWithAuthorizationCode(
            AuthorizationCode(authorizationCode),
        ).getOrThrow()
}

Authorize request via Pre-Authorization Code Flow

Given an issuer that is initialized with a specific credential offer, use Pre-Authorization Code Flow to authorize an issuance request. It is expected that the credential offer will contain the pre-authorization code and defines the need to provide a pin or not.

import eu.europa.ec.eudi.openid4vci.*

with(issuer) {
    val pin = ... // Pin retrieved from another channel 
    val authorizedRequest = authorizeWithPreAuthorizationCode(pin).getOrThrow()    
}

Request a single credential issuance

Given an authorizedRequest and in the context of an issuer a single credential issuance request can be placed as follows

import eu.europa.ec.eudi.openid4vci.*

with(issuer) {
    val requestPayload = IssuanceRequestPayload.ConfigurationBased(credentialConfigurationId, null)
    val submittedRequest = authorized.requestSingle(requestPayload, proofSigner).getOrThrow()

    when (submittedRequest) {
        is SubmittedRequest.Success -> {
            when (val issuedCredential = submittedRequest.credentials[0]) {
                is IssuedCredential.Issued -> issuedCredential.credential
                is IssuedCredential.Deferred -> {
                    deferredCredentialUseCase(issuer, authorized, issuedCredential)
                }
            }
        }
        is SubmittedRequest.Failed -> // handle failed request
        is SubmittedRequest.InvalidProof -> // handle a specific case of missing or invalid proof(s) 
    }
}

NOTE: Only credentials that were included in credential offer that initialized the Issuer component can be passed.

Request batch credential issuance

Given an authorizedRequest and in the context of an issuer a batch credential issuance request can be placed as follows

import eu.europa.ec.eudi.openid4vci.*

with(issuer) {    
    val submittedRequest = authorizedRequest.requestBatch(credentialsMetadata).getOrThrow()

    when (submittedRequest) {
        is SubmittedRequest.Success -> {
            val results = submittedRequest.credentials.map {
                when (it) {
                    is CredentialIssuanceResponse.Result.Issued -> it.credential
                    is CredentialIssuanceResponse.Result.Deferred -> it.transactionId
                }
            }            
        }
        is SubmittedRequest.Failed -> // handle failed request
        is SubmittedRequest.InvalidProof -> // handle a specific case of missing or invalid proof 
    }
}

NOTE: Only credentials that were included in credential offer that initialized the Issuer component can be passed.

Resolve a credential offer presented by issuer

A CredentialOfferRequestResolver uses internally the two metadata resolvers mentioned above to resolve metadata of issuer and its authorization server

Given a credential offer url use CredentialOfferRequestResolver the following way to validate and resolve it to CredentialOffer

import eu.europa.ec.eudi.openid4vci.*

val credentialOfferRequestResolver = CredentialOfferRequestResolver()
val credentialOffer: CredentialOffer = credentialOfferRequestResolver.resolve(coUrl).getOrThrow()

Resolve Credential Issuer and authorization server metadata

To obtain the credentials issuer metadata use CredentialIssuerMetadataResolver the following way

import eu.europa.ec.eudi.openid4vci.*

val credentialIssuerIdentifier = CredentialIssuerId("https://....").getOrThrow() // credential issuer id is a https url with no query or fragment components
val resolver = CredentialIssuerMetadataResolver() // get a default implementation of the CredentialIssuerMetadataResolver interface 
val metadata: CredentialIssuerMetadata = resolver.resolve(credentialIssuerIdentifier).getOrThrow()  // fetch and parse credential issuer metadata

In case of metadata parsing failure a Result.failure() will be returned to caller wrapping the exception thrown while parsing metadata.

To obtain the authorization server's metadata use AuthorizationServerMetadataResolver the following way

import eu.europa.ec.eudi.openid4vci.*

val resolver = AuthorizationServerMetadataResolver() // get a default implementation of the AuthorizationServerMetadataResolver interface
val metadata: CIAuthorizationServerMetadata = resolver.resolve(HttpsUrl("https://...")).getOrThrow() // fetch and parse authorization server metadata

There is also a convenient method that obtains the credential issuer metadata & the metadata of all authorization servers with a single call

import eu.europa.ec.eudi.openid4vci.*

val credentialIssuerIdentifier = CredentialIssuerId("https://....").getOrThrow()
val (issuerMetadata, authServersMetadata) = Issuer.metaData(httpClient, credentialIssuerIdentifier)

Features supported

Issuer metadata

In section 11.2.2 specification recommends the use of header Accept-Language to indicate the language(s) preferred for display. Current version of the library does not support this. In section 11.2.3 specification details the metadata an issuer advertises through its metadata endpoint. Current version of the library supports all metadata specified there except signed_metadata attribute.

Authorization

Specification defines (section 5.1.1) that a credential's issuance can be requested using authorization_details or scope parameter when using authorization code flow. The current version of the library supports usage of both parameters. Though for authorization_details we don't yet support the format attribute and its specializations per profile as specified in Appendix A. Only credential_configuration_id attribute is supported.

The same stands for the token endpoint when (as specified in section 6.2) server response includes authorization_details. In this case too, the library does not support authorization details that include format attribute.

Demonstrating Proof of Possession (DPoP)

Library supports RFC9449. In addition to bearer authentication scheme, library can be configured to use DPoP authentication provided that the authorization server, that protects the credential issuer, supports this feature as well.

Credential Request

The current version of the library implements integrations with issuer's Credential Endpoint, Batch Credential Endpoint, Deferred Credential Endpoint and Notification Endpoint.

Credential Format Profiles

OpenId4VCI specification defines several extension points to accommodate the differences across Credential formats. The current version of the library fully supports ISO mDL, IETF SD-JWT VC and W3C VC DM (VC Signed as a JWT, Not Using JSON-LD) profiles.

Proof Types

OpenId4VCI specification (draft 13) defines two types of proofs that can be included in a credential issuance request, JWT proof type, and CWT proof type. The current version of the library supports only JWT proof types

How to contribute

We welcome contributions to this project. To ensure that the process is smooth for everyone involved, follow the guidelines found in CONTRIBUTING.md.

License

Third-party component licenses

License details

Copyright (c) 2023 European Commission

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

eudi-lib-jvm-openid4vci-kt's People

Contributors

babisroutis avatar christosservosncin avatar dependabot[bot] avatar dzarras avatar pochopsp avatar vafeini avatar ydanneg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eudi-lib-jvm-openid4vci-kt's Issues

Missing issuer claim from Proof of type JWT

In file RequestIssuanceImpl

we should add the following

         ProofBuilder.ofType(ProofType.JWT) {
            iss(config.clientId)
            aud(issuerMetadata.credentialIssuerIdentifier.toString())
            publicKey(proofSigner.getBindingKey())
            credentialSpec(credentialSupported)
            nonce(cNonce.value)
            build(proofSigner)
        }

That is to add the issuer claim

Align Credential Request/Response to Draft 13

  • Support the alternative way of specifying credential to be issued in terms of credential_identifier
  • Handle attribute 'notification_id' when parsing the credential response.
  • Attribute 'format' removed from issuance response.

Allow wallet to define its policy about response encryption

So far the library tries to match the issuer's requirements for the encryption of the response (that carries the issued credential).
In general VCI allows the issuer to chose one of the following options:

  • Not Used (credential_response_encryption is not provided to issuer's metadata)
  • Supported but not required (credential_response_encryption is present and encryption_required is false)
  • Required (credential_response_encryption is present and encryption_required is true)

Wallet could also define a similar policy independently of the issuer's choice. During resolution of a credential offer there could be a step to assure that those two policies are compatible and proceed with the issuance.

The wallet's policy can be the following:

  • Required
  • Supported
Required Supported
Not used Boom No encryption
Supported but not required Encrypt Try to encrypt. Fallback to no encryption
Required Encrypt Encrypt

Use of "resource" parameter in authorization request

Parameter resource parameter should be included in the authorization request when issuer's metadata specify a different authorization server that protects issuer's endpoints. Parameter property must be set to the Credential Issuer's identifier.

From spec (section 5.1.2):
"If the Credential Issuer metadata contains an authorization_servers property, it is RECOMMENDED to use a resource parameter [RFC8707] whose value is the Credential Issuer's identifier value to allow the AS to differentiate Credential Issuers."

Re-arrange example

Currently our example assumes that the a wallet knows somehow

  • A CredentialIssuerId
  • The scope(s) that correspond to every credential that can be issued.

With that at hand, we obtain the metadata and then query them to locate the CredentialId that we are interested in.

We can improve this by

  • assuming that the wallet has a CredentialOffer (with grant = authorization code)
  • Even better, should we add to the PID issuer the ability to make CredentialOffer we can bring in to the example and effectively test our CredentialOfferResolver

By the way, in future the result of resoliving an offer could be the creation of an Issuer instance

Batch credential requests

Currently library does not support integration with issuer's Batch Credential Endpoint (section-8).
Api must be extended in a way that allows the caller to submit Batch Credential Requests

Improve package/code structure

HTTP clients for OAUTH2 & Credential Issuer use transfer objects - representing requests / responses.
Some of those transfer objects are in .internal.format package whereas others are in .internal

We need to improve this and in particular put all related transfer object into the same package

Update Issuer metadata `supported_credentials`

Attribute supported_credentials has been change from a list of credential metadata, to map where each entry is a key (a unique identifier for the specific credential) and the value is an object with the credential metadata

Support user_hint ?

OpenId4VCI (draft 13) foresees the use of optional parameter user_hint in the credential request.

user_hint: OPTIONAL. JSON String containing an opaque user hint the Wallet MAY use in subsequent callbacks to optimize the user's experience. This is RECOMMENDED in Dynamic Credential Requests
here

Do we need to support this?

Deferred credential requests

Currently library does not support integration with issuer's Deferred Credential Endpoint (section-9).
Api must be extended in a way that allows the caller to submit Deferred Credential Requests passing the transaction_id returned from issuer as response to the initial credential issuance request

ProofBuilder should take into account supported signing algoritims

ProofBuilder and in particulat the JwtProofBuilder currently verifies - using issuer metadata - that the issuer support JWT proof.

In draft 13, a new mandatory attribute was added to issuer metadata, named proof_signing_alg_values_supported which is defined as

proof_signing_alg_values_supported: REQUIRED. Array of case sensitive strings that identify the algorithms that the Issuer supports for this proof type. The Wallet uses one of them to sign the proof.

This information can be used that wallet provides a ProofSigner that supports the issuer defined algorithms

Update Credential Offer

Credential offer parameters

  • Changed the definition of credentials parameter. Now, it is only an array of string
  • grantsChanged to optional. If not provided, Wallet must take the flows supported from OAuth2 server metadata.
  • Also, the contents of Grant Types has been changed. In both case a new option field named authorization_server has been added

Align parsing of `credential_response_encryption` to draft 13

Draft 13 clarified the meaning of encryption_required especially in case is set to false.

Currently, our library checks that when this flag is set to false, issuer should not define encryption methods.

Draft 13 clarifies that this is not the case. When setting false the flag it is ok to have encryption methods and it is up to the wallet whether it will request for an encrypted response or not.

In this case, it would be nice to change our code to request encryption from the issuer or add a configuration option

Sonar warning after upgrade

The new version of the sonar cloud gradle plugin that we use to perform the analysis, gives the following warning

The 'sonarqube' task depends on compile tasks. This behavior is now deprecated and will be removed in version 5.x. To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' and make sure your project is compiled, before analysis has started.
The 'sonar' task depends on compile tasks. This behavior is now deprecated and will be removed in version 5.x. To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' and make sure your project is compiled, before analysis has started.
Kotlin DSL property assignment is an incubating feature.

I think that this means that we should check again our github action.

BTW, the message can be reproduced by invoking any gradle operation

Changes to spec (draft 19 - 10/11/'23)

Credentials Offer

credentials parameter

Changed the definition of credentials parameter.
Now, it is only an array of string

grants.

Changed to optional. If not provided, Wallet must take the flows supported from OAuth2 server metadata.
Also, the contents of Grant Types has been changed. In both case a new option field named authorization_server has been added

Note It is not clear to me the omission of grants. OAuth2 server metadata don't have a placeholder for pre-authorized_code

Token response

Added a new attribute named authorization_details
Fortunately, it is required in authorization_details have been used

Credential Request

Added a new field credential_identifier. It is required only in case that authorization_details have been used.

Credential Issuer Metadata Parameters

  • Added multiple authorization_servers
  • Added proof_types_supported

Refresh credential

New feature, using refresh_token

Derived issues:

Investigate support of did methods to include in Proof JWT builder

It seems that there are two DID methods we can support with minimal effort.

Those methods are

  1. did:jwk
  2. did:key

Both methods use the following approach:

Given that you have a key pair, you can produce a did by serializing into a string the public key (serialization is different between the two methods) and the prepend the appropriate appropriate did:jwk: or did:key: to form a did (and a did url).

A party that receives such a did given that the pub key is trusted, it can map it to a predefined did document (different for each method).

So, given that our Proof builder already supports jwk claim we can expanded to support kid ( addressed in #42 )

Align Credential offer to Draft 13

The contents of a credential offer has been changed in the pre-authorized code case.

A new attribute tx_code replaces user_pin and some more new metadata were added

AuthorizeIssuance.prepareAuthorizationRequest should take or return generated state

Dear team,

State is currently generated inside AuthorizeIssuanceImpl and can not be extracted or stored after calling AuthorizeIssuance.prepareAuthorizationRequest() without parsing resulting authorizationCodeURL

At the end of the flow Wallet instance will get the code and state
(e.g. "state=umerLYauAS-E33UK64uD3SMoC2orCslWku9xSrGm5Rc&code=blDtU1XSgFyMv1FoBg6402GRaXHsDZ8JgKgzVR-Sv-E")
At this point Wallet instance MUST parse this url to get the code to continue the flow by calling authorizeWithAuthorizationCode on a persisted AuthorizationRequestPrepared object. At this point Wallet needs to be sure this persisted object matches the original state.

I see several solutions:

  • Provide generated state as a parameter to (AuthorizeIssuance.prepareAuthorizationRequest(state))
  • Return pair of state and AuthorizationRequestPrepared object as the result of a successful authorization
  • Add state to AuthorizationRequestPrepared object
  • do nothing and just parse authorizationCodeURL

All these solutions will help Wallets, to restore their state (AuthorizationRequestPrepared) by a state value and continue the flow.

Your thoughts?

Gennadi

Align Credential Issuer metada to draft 13

Changes

  • #168
  • Add credential_response_encryption. These should include alg_values_supported , enc_values_supported and encryption_required which were used to be top-level items
  • New attribute credential_identifiers_supported added
  • Renamed to credential_configurations_supported
  • Add an additional value to proof_types_supported ldp_vp

Investigate against draft 12 ProofBuilder constraints

Check the cryptographicSuitesSupported constraint of the JwtProofBuilder

Is it relevant. In draft 13 attibute has been removed

checkNotNull(claimsSet.claims["nonce"]) {
                "Claim 'nonce' is missing"
            }
            if (!credentialSpec!!.cryptographicSuitesSupported.contains(algorithm.name)) {
                throw CredentialIssuanceError.ProofGenerationError.CryptographicSuiteNotSupported
            }
            if (!credentialSpec!!.proofTypesSupported.contains(ProofType.JWT)) {
                throw CredentialIssuanceError.ProofGenerationError.ProofTypeNotSupported
            }

Support DPoP

RFC9449 defines DPoP JWT as a way to:

  • Ensure that an issued access_token is used by the client (wallet) that requested it, and
  • Constraint the usage of the access_token

This DPoP (demonstration of Proof of Possession) must not be confused with Proof Of Possession that may be used within the credential request.

The basic requirement is:

Token Request

  • Lib can place a request against the Token Endpoint (to obtain access_token) adding as an HTTP header a specially prepared DPoP JWT. htm and htu should point to token endpoint method and URL (no fragment, no query)
  • In case OAUTH2 server supports DPoP, it will reply with
    • token_type equal to DPoP, otherwise
    • bearer
  • Library should store this information (whether DPoP was supported)

Placing a call to Issuer Endpoints
For accessing one of the endpoints of the issuer (that require access_token: issuance, batch, deferred, notification) , library must

  • generate a new DPoP JWT . htm and htu point to the method and endpoint used
  • add the DPoP as an HTTP header
  • Change the way access token is placed as a header. Instead of Authorization bearer <access_token> to `Authorization DPoP <access_token>'

Accessing credential offer via `Issuer`

When instantiating Issuer using a deep link representing a credential offer, caller has no access to the resolved credential offer.

A solution would be to make the resolved credential offer accessible from the Issuer

PIN must be present when offer defines as such in the 'pre-authorized_code' grand

From spec (section 4.1.1 ):
"user_pin_required: OPTIONAL. Boolean value specifying whether the AS expects presentation of a user PIN along with the Token Request in a Pre-Authorized Code Flow. Default is false. This PIN is intended to bind the Pre-Authorized Code to a certain transaction to prevent replay of this code by an attacker that, for example, scanned the QR code while standing behind the legitimate user. It is RECOMMENDED to send a PIN via a separate channel. If the Wallet decides to use the Pre-Authorized Code Flow, a PIN value MUST be sent in the user_pin parameter with the respective Token Request"

Currently the library does not enforce the provision of a pin code when authorizing an issuance request if credential offer grant type is pre-authorized_code and property "user_pin_required" is present and its value is true.

Include `redirectUri` in `DispatchOutcome.VerifierResponse.Rejected`

DispatchOutcome.VerifierResponse.Rejected must be updated to a data class that contains an nullable property redirectUri similar to DispatchOutcome.VerifierResponse.Accepted.

Even in the case that the user didn't give his consensus to present a credential, the verifier might want to be redirect to a certain uri to display extra information to the user.

PushedAuthorizationRequest: AuthorizationDetails: missing locations

Hi.

Specification says we should add (conditionally) Location to AuthorizationDetails which is missing now.
https://github.com/eu-digital-identity-wallet/eudi-lib-jvm-openid4vci-kt/blob/main/src/main/kotlin/eu/europa/ec/eudi/openid4vci/internal/AuthorizationServerClient.kt#L365

If the Credential Issuer metadata contains an authorization_servers parameter, 
the authorization detail's locations common data field MUST be set to the Credential 
Issuer Identifier value.

ref: https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#section-5.1.1

Combine scopes and authorization_details when authorizing issuance request

In current implementation of the library authorization of an issuance request is based on the existence of a scope attribute of a credential configuration in issuer's metadata. In case the attribute is missing authorization requests do not include these credentials.

This behavior should be changed as follows:

  • In case credential configuration includes a scope attribute for the credential use it.
  • In case credential configuration does not include a scope attribute create the respective authorization_detail element and include it in the authorization request.

Thus the resulting authorization requests can include both scopes and authorization details attibutes.

Extend Proof builder to support x5c & kid

Currently, JwtProofBuilder supports jwk claim.
We could extended to support, also

  • kid claim
  • x5c claim

To do so, perhaps some of the checks about compatibility of JWK & Signing Alg need to be removed

Add supported languages to config

With draft 13, when requesting credential issuer meta-data you can pass one or more languages
via Accept-Language header parameter.

Issuer can use this value to adjust the display information of the supported credential configurations.

So, probably makes sense to add a set of supported languages to the issuer configuration

Check optional fields in Kotlinx.serialization JSON

  • We need to check all data classes that are serialized with kotlinx.serializaiton JSON. Optional(nullable) attributes, must have always a default value, otherwise during decode we receive an error.
  • Also when calling Json.decode() function we should use a decoder that ignores unknown values.

An example of this problem is the following

@Serializable
data class CredentialDefinitionTO(
  @SerialName("type") val type: String,
  @SerialName("claims") val claims: Map<String, ClaimTO>?,
)

The claims attribute should have a default value either null or non empty map

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.