Skip to content

Commit 5b1178d

Browse files
committed
feat: Pass in issuer_state to regular state in auth code flow, so we get a better integration with any external OIDC solution
1 parent 09cbd0d commit 5b1178d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

packages/issuer/lib/VcIssuer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,8 @@ export class VcIssuer {
626626

627627
const { didDocument, did, jwt } = jwtVerifyResult
628628
const { header, payload } = jwt
629-
const { iss, aud, iat, nonce, issuer_state } = payload
629+
const { iss, aud, iat, nonce } = payload
630+
const issuer_state = ('issuer_state' in credentialRequest && credentialRequest.issuer_state) ? credentialRequest.issuer_state : undefined
630631
if (!nonce && !issuer_state) {
631632
throw Error('No nonce was found in the Proof of Possession')
632633
}

packages/oid4vci-common/lib/types/v1_0_13.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export interface CredentialRequestV1_0_13Common extends ExperimentalSubjectIssua
110110
proof?: ProofOfPossession;
111111

112112
// We allow sending a issuer state back to the credential offer in case an auth code flow is used with an external AS and no nonces are used (not recommended), but does allow to integrate any OIDC server
113-
state?: string;
113+
issuer_state?: string;
114114
}
115115

116116
export type CredentialRequestV1_0_13 = CredentialRequestV1_0_13Common &

0 commit comments

Comments
 (0)