Skip to content

Commit

Permalink
feat: Pass in issuer_state to regular state in auth code flow, so we …
Browse files Browse the repository at this point in the history
…get a better integration with any external OIDC solution
  • Loading branch information
nklomp committed Feb 19, 2025
1 parent 09cbd0d commit 5b1178d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/issuer/lib/VcIssuer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,8 @@ export class VcIssuer {

const { didDocument, did, jwt } = jwtVerifyResult
const { header, payload } = jwt
const { iss, aud, iat, nonce, issuer_state } = payload
const { iss, aud, iat, nonce } = payload
const issuer_state = ('issuer_state' in credentialRequest && credentialRequest.issuer_state) ? credentialRequest.issuer_state : undefined
if (!nonce && !issuer_state) {
throw Error('No nonce was found in the Proof of Possession')
}
Expand Down
2 changes: 1 addition & 1 deletion packages/oid4vci-common/lib/types/v1_0_13.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface CredentialRequestV1_0_13Common extends ExperimentalSubjectIssua
proof?: ProofOfPossession;

// 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
state?: string;
issuer_state?: string;
}

export type CredentialRequestV1_0_13 = CredentialRequestV1_0_13Common &
Expand Down

0 comments on commit 5b1178d

Please sign in to comment.