Skip to content

Commit

Permalink
chore: added redirectUri support
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Oct 2, 2024
1 parent 0d48112 commit 9a9f1ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/siop-oid4vp/lib/authorization-request/Payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const createAuthorizationRequestPayload = async (
...(state && { state }),
...(registration.payload && isTarget(PropertyTarget.AUTHORIZATION_REQUEST, registration.clientMetadataOpts.targets) ? registration.payload : {}),
...(claims && { claims }),
...(opts.redirectUri && { redirect_uri: opts.redirectUri })
}

return removeNullUndefined(authRequestPayload)
Expand Down
1 change: 1 addition & 0 deletions packages/siop-oid4vp/lib/authorization-request/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ interface AuthorizationRequestCommonOpts<CT extends ClaimPayloadCommonOpts> {
payload?: AuthorizationRequestPayloadOpts<CT>
requestObject: RequestObjectOpts<CT>
uriScheme?: Schema | string // Use a custom scheme for the URI. By default openid:// will be used
redirectUri?: string;
}

export type AuthorizationRequestOptsVID1 = AuthorizationRequestCommonOpts<ClaimPayloadOptsVID1>
Expand Down
4 changes: 4 additions & 0 deletions packages/siop-oid4vp/lib/rp/RP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ export class RP {
newOpts.requestObject.payload.claims = { ...newOpts.requestObject.payload.claims, ...claimsWithTarget.propertyValue }
}
}

if(this._createRequestOptions.redirectUri !== undefined) {
newOpts.redirectUri = this._createRequestOptions.redirectUri
}
return newOpts
}

Expand Down

0 comments on commit 9a9f1ab

Please sign in to comment.