Skip to content

Commit

Permalink
Merge pull request #137 from auer-martin/fix/redirect_uri
Browse files Browse the repository at this point in the history
fix: redirect uri should not be set with direct_post
  • Loading branch information
nklomp authored Aug 2, 2024
2 parents 8af5f49 + 4720956 commit 4178ba5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/siop-oid4vp/lib/request-object/RequestObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ import { JwtIssuer, parseJWT } from '@sphereon/oid4vc-common'
import { ClaimPayloadCommonOpts, ClaimPayloadOptsVID1, CreateAuthorizationRequestOpts } from '../authorization-request'
import { assertValidAuthorizationRequestOpts } from '../authorization-request/Opts'
import { fetchByReferenceOrUseByValue, removeNullUndefined } from '../helpers'
import { AuthorizationRequestPayload, JwtIssuerWithContext, RequestObjectJwt, RequestObjectPayload, SIOPErrors } from '../types'
import { parseJWT } from '../helpers/jwtUtils'
import {
AuthorizationRequestPayload,
JwtIssuer,
JwtIssuerWithContext,
RequestObjectJwt,
RequestObjectPayload,
ResponseMode,
SIOPErrors,
} from '../types'

import { assertValidRequestObjectOpts } from './Opts'
import { assertValidRequestObjectPayload, createRequestObjectPayload } from './Payload'
Expand Down Expand Up @@ -93,7 +102,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 4178ba5

Please sign in to comment.