Skip to content

Commit

Permalink
fix: redirect uri should not be set with direct_post
Browse files Browse the repository at this point in the history
  • Loading branch information
auer-martin committed Aug 1, 2024
1 parent 45c4672 commit 42c8ddd
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/siop-oid4vp/lib/request-object/RequestObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import { ClaimPayloadCommonOpts, ClaimPayloadOptsVID1, CreateAuthorizationReques
import { assertValidAuthorizationRequestOpts } from '../authorization-request/Opts'
import { fetchByReferenceOrUseByValue, removeNullUndefined } from '../helpers'
import { parseJWT } from '../helpers/jwtUtils'
import { AuthorizationRequestPayload, JwtIssuer, JwtIssuerWithContext, RequestObjectJwt, RequestObjectPayload, SIOPErrors } from '../types'
import {
AuthorizationRequestPayload,
JwtIssuer,
JwtIssuerWithContext,
RequestObjectJwt,
RequestObjectPayload,
ResponseMode,
SIOPErrors,
} from '../types'

import { assertValidRequestObjectOpts } from './Opts'
import { assertValidRequestObjectPayload, createRequestObjectPayload } from './Payload'
Expand Down Expand Up @@ -92,7 +100,11 @@ export class RequestObject {
} else if (jwtIssuer.method === 'x5c') {
this.payload.iss = jwtIssuer.issuer
this.payload.client_id = jwtIssuer.issuer
this.payload.redirect_uri = jwtIssuer.issuer

if (this.opts.payload.response_mode !== ResponseMode.DIRECT_POST) {
this.payload.redirect_uri = jwtIssuer.issuer
}

this.payload.client_id_scheme = jwtIssuer.clientIdScheme

const header = { x5c: jwtIssuer.x5c, typ: 'JWT' }
Expand Down

0 comments on commit 42c8ddd

Please sign in to comment.