diff --git a/src/authorization-response/AuthorizationResponse.ts b/src/authorization-response/AuthorizationResponse.ts index d36783a..fc09557 100644 --- a/src/authorization-response/AuthorizationResponse.ts +++ b/src/authorization-response/AuthorizationResponse.ts @@ -120,7 +120,9 @@ export class AuthorizationResponse { presentationDefinitions, presentations: wrappedPresentations, verificationCallback: verifyOpts.verification.presentationVerificationCallback, - opts: { ...responseOpts.presentationExchange, hasher: verifyOpts.hasher }, + opts: { ...responseOpts.presentationExchange, + presentationSubmission: (responseOpts.presentationExchange.presentationSubmission ?? authorizationResponsePayload.presentation_submission), + hasher: verifyOpts.hasher }, }); } diff --git a/src/authorization-response/Payload.ts b/src/authorization-response/Payload.ts index 7e65300..2c395aa 100644 --- a/src/authorization-response/Payload.ts +++ b/src/authorization-response/Payload.ts @@ -19,11 +19,13 @@ export const createResponsePayload = async ( // If state was in request, it must be in response const state: string | undefined = await authorizationRequest.getMergedProperty('state'); + const payload = await authorizationRequest.requestObject.getPayload(); const responsePayload: AuthorizationResponsePayload = { ...(responseOpts.accessToken && { access_token: responseOpts.accessToken }), ...(responseOpts.tokenType && { token_type: responseOpts.tokenType }), ...(responseOpts.refreshToken && { refresh_token: responseOpts.refreshToken }), + ...(payload?.nonce && { nonce: payload.nonce}), expires_in: responseOpts.expiresIn || 3600, state, };