@pagopa/io-react-native-wallet 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/commonjs/credential/issuance/README.md +32 -14
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js +1 -0
- package/lib/commonjs/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +5 -3
- package/lib/commonjs/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js +2 -1
- package/lib/commonjs/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js +8 -5
- package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/index.js +2 -1
- package/lib/commonjs/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.0.0/mappers.js +3 -1
- package/lib/commonjs/credential/issuance/v1.0.0/mappers.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js +108 -69
- package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/index.js +2 -1
- package/lib/commonjs/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js +9 -10
- package/lib/commonjs/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credential/presentation/api/types.js.map +1 -1
- package/lib/commonjs/credential/presentation/common/utils/http.js +9 -4
- package/lib/commonjs/credential/presentation/common/utils/http.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -1
- package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
- package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js +2 -0
- package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/mappers.js +1 -1
- package/lib/commonjs/credential/presentation/v1.3.3/mappers.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +2 -1
- package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js +23 -0
- package/lib/commonjs/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
- package/lib/commonjs/credentials-catalogue/v1.0.0/index.js +3 -1
- package/lib/commonjs/credentials-catalogue/v1.0.0/index.js.map +1 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/commonjs/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/commonjs/utils/config.js +9 -1
- package/lib/commonjs/utils/config.js.map +1 -1
- package/lib/module/credential/issuance/README.md +32 -14
- package/lib/module/credential/issuance/api/IssuerConfig.js +1 -0
- package/lib/module/credential/issuance/api/IssuerConfig.js.map +1 -1
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js +5 -3
- package/lib/module/credential/issuance/common/06-verify-and-parse-credential.sdjwt.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js +2 -1
- package/lib/module/credential/issuance/v1.0.0/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js +6 -4
- package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/index.js +3 -2
- package/lib/module/credential/issuance/v1.0.0/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.0.0/mappers.js +3 -1
- package/lib/module/credential/issuance/v1.0.0/mappers.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js +1 -1
- package/lib/module/credential/issuance/v1.3.3/02-start-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js +108 -70
- package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js +1 -1
- package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/index.js +3 -2
- package/lib/module/credential/issuance/v1.3.3/index.js.map +1 -1
- package/lib/module/credential/issuance/v1.3.3/mappers.js +9 -10
- package/lib/module/credential/issuance/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credential/presentation/api/types.js.map +1 -1
- package/lib/module/credential/presentation/common/utils/http.js +9 -4
- package/lib/module/credential/presentation/common/utils/http.js.map +1 -1
- package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -1
- package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js +11 -10
- package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js +2 -0
- package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
- package/lib/module/credential/presentation/v1.3.3/mappers.js +1 -1
- package/lib/module/credential/presentation/v1.3.3/mappers.js.map +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +1 -1
- package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
- package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js +16 -0
- package/lib/module/credentials-catalogue/common/get-status-l10n-ids.js.map +1 -0
- package/lib/module/credentials-catalogue/v1.0.0/index.js +3 -1
- package/lib/module/credentials-catalogue/v1.0.0/index.js.map +1 -1
- package/lib/module/credentials-catalogue/v1.3.3/index.js +3 -1
- package/lib/module/credentials-catalogue/v1.3.3/index.js.map +1 -1
- package/lib/module/utils/config.js +7 -0
- package/lib/module/utils/config.js.map +1 -1
- package/lib/typescript/credential/issuance/api/02-start-user-authorization.d.ts +1 -0
- package/lib/typescript/credential/issuance/api/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/03-complete-user-authorization.d.ts +19 -5
- package/lib/typescript/credential/issuance/api/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts +1 -0
- package/lib/typescript/credential/issuance/api/IssuerConfig.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/common/06-verify-and-parse-credential.sdjwt.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/02-start-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts +2 -1
- package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts +1 -0
- package/lib/typescript/credential/issuance/v1.0.0/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts +2 -1
- package/lib/typescript/credential/issuance/v1.3.3/03-complete-user-authorization.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts +7 -4
- package/lib/typescript/credential/issuance/v1.3.3/mappers.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts +1 -1
- package/lib/typescript/credential/presentation/api/types.d.ts +3 -7
- package/lib/typescript/credential/presentation/api/types.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/common/utils/http.d.ts +1 -1
- package/lib/typescript/credential/presentation/common/utils/http.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/05-verify-request-object.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/07-send-authorization-response.d.ts.map +1 -1
- package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts +8 -8
- package/lib/typescript/credential/presentation/v1.3.3/types.d.ts +8 -8
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +6 -0
- package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/api/index.d.ts +14 -2
- package/lib/typescript/credentials-catalogue/api/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts +9 -0
- package/lib/typescript/credentials-catalogue/common/get-status-l10n-ids.d.ts.map +1 -0
- package/lib/typescript/credentials-catalogue/v1.0.0/index.d.ts.map +1 -1
- package/lib/typescript/credentials-catalogue/v1.3.3/index.d.ts.map +1 -1
- package/lib/typescript/trust/v1.3.3/types.d.ts +6 -4
- package/lib/typescript/trust/v1.3.3/types.d.ts.map +1 -1
- package/lib/typescript/utils/config.d.ts +4 -0
- package/lib/typescript/utils/config.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/credential/issuance/README.md +32 -14
- package/src/credential/issuance/api/02-start-user-authorization.ts +1 -0
- package/src/credential/issuance/api/03-complete-user-authorization.ts +26 -5
- package/src/credential/issuance/api/IssuerConfig.ts +1 -0
- package/src/credential/issuance/common/06-verify-and-parse-credential.sdjwt.ts +8 -4
- package/src/credential/issuance/v1.0.0/02-start-user-authorization.ts +7 -1
- package/src/credential/issuance/v1.0.0/03-complete-user-authorization.ts +16 -4
- package/src/credential/issuance/v1.0.0/index.ts +4 -2
- package/src/credential/issuance/v1.0.0/mappers.ts +5 -0
- package/src/credential/issuance/v1.3.3/02-start-user-authorization.ts +1 -1
- package/src/credential/issuance/v1.3.3/03-complete-user-authorization.ts +138 -94
- package/src/credential/issuance/v1.3.3/05-obtain-credential.ts +1 -1
- package/src/credential/issuance/v1.3.3/index.ts +4 -2
- package/src/credential/issuance/v1.3.3/mappers.ts +9 -10
- package/src/credential/presentation/api/05-verify-request-object.ts +1 -1
- package/src/credential/presentation/api/types.ts +3 -7
- package/src/credential/presentation/common/utils/http.ts +2 -2
- package/src/credential/presentation/v1.0.0/07-send-authorization-response.ts +1 -1
- package/src/credential/presentation/v1.3.3/05-verify-request-object.ts +15 -14
- package/src/credential/presentation/v1.3.3/07-send-authorization-response.ts +2 -0
- package/src/credential/presentation/v1.3.3/mappers.ts +1 -1
- package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +4 -1
- package/src/credentials-catalogue/api/index.ts +15 -0
- package/src/credentials-catalogue/common/get-status-l10n-ids.ts +25 -0
- package/src/credentials-catalogue/v1.0.0/index.ts +2 -0
- package/src/credentials-catalogue/v1.3.3/index.ts +2 -0
- package/src/utils/config.ts +7 -0
- package/lib/commonjs/credential/presentation/common/utils.js +0 -28
- package/lib/commonjs/credential/presentation/common/utils.js.map +0 -1
- package/lib/module/credential/presentation/common/utils.js +0 -21
- package/lib/module/credential/presentation/common/utils.js.map +0 -1
- package/lib/typescript/credential/presentation/common/utils.d.ts +0 -11
- package/lib/typescript/credential/presentation/common/utils.d.ts.map +0 -1
- package/src/credential/presentation/common/utils.ts +0 -30
|
@@ -7,7 +7,11 @@ import {
|
|
|
7
7
|
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
8
8
|
import parseUrl from "parse-url";
|
|
9
9
|
import type { DcqlQuery } from "dcql";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
IssuerResponseError,
|
|
12
|
+
UnimplementedFeatureError,
|
|
13
|
+
ValidationFailed,
|
|
14
|
+
} from "../../../utils/errors";
|
|
11
15
|
import {
|
|
12
16
|
decode,
|
|
13
17
|
SignJWT,
|
|
@@ -70,7 +74,7 @@ export const buildAuthorizationUrl: IssuanceApi["buildAuthorizationUrl"] =
|
|
|
70
74
|
return { authUrl };
|
|
71
75
|
};
|
|
72
76
|
|
|
73
|
-
export const
|
|
77
|
+
export const completePidUserAuthorizationWithQueryMode: IssuanceApi["completePidUserAuthorizationWithQueryMode"] =
|
|
74
78
|
async (authRedirectUrl) => {
|
|
75
79
|
Logger.log(
|
|
76
80
|
LogLevel.DEBUG,
|
|
@@ -81,6 +85,14 @@ export const completeUserAuthorizationWithQueryMode: IssuanceApi["completeUserAu
|
|
|
81
85
|
return parseAuthorizationResponse(query);
|
|
82
86
|
};
|
|
83
87
|
|
|
88
|
+
export const completeEaaUserAuthorizationWithQueryMode: IssuanceApi["completeEaaUserAuthorizationWithQueryMode"] =
|
|
89
|
+
() => {
|
|
90
|
+
throw new UnimplementedFeatureError(
|
|
91
|
+
"completeEaaUserAuthorizationWithQueryMode",
|
|
92
|
+
"1.0.0"
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
84
96
|
export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCredentialToBePresented"] =
|
|
85
97
|
async (issuerRequestUri, clientId, issuerConf, appFetch = fetch) => {
|
|
86
98
|
Logger.log(
|
|
@@ -130,7 +142,7 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
|
|
|
130
142
|
requestObject,
|
|
131
143
|
_issuerConfig,
|
|
132
144
|
pid,
|
|
133
|
-
{ wiaCryptoContext,
|
|
145
|
+
{ wiaCryptoContext, appFetch = fetch }
|
|
134
146
|
) => {
|
|
135
147
|
Logger.log(
|
|
136
148
|
LogLevel.DEBUG,
|
|
@@ -139,7 +151,7 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
|
|
|
139
151
|
|
|
140
152
|
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(
|
|
141
153
|
requestObject.dcql_query as DcqlQuery,
|
|
142
|
-
[
|
|
154
|
+
[pid]
|
|
143
155
|
);
|
|
144
156
|
|
|
145
157
|
const authRequestObject = {
|
|
@@ -3,7 +3,8 @@ import { evaluateIssuerTrust } from "./01-evaluate-issuer-trust";
|
|
|
3
3
|
import { startUserAuthorization } from "./02-start-user-authorization";
|
|
4
4
|
import {
|
|
5
5
|
continueUserAuthorizationWithMRTDPoPChallenge,
|
|
6
|
-
|
|
6
|
+
completePidUserAuthorizationWithQueryMode,
|
|
7
|
+
completeEaaUserAuthorizationWithQueryMode,
|
|
7
8
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
8
9
|
buildAuthorizationUrl,
|
|
9
10
|
getRequestedCredentialToBePresented,
|
|
@@ -20,7 +21,8 @@ export const Issuance: IssuanceApi = {
|
|
|
20
21
|
evaluateIssuerTrust,
|
|
21
22
|
startUserAuthorization,
|
|
22
23
|
buildAuthorizationUrl,
|
|
23
|
-
|
|
24
|
+
completePidUserAuthorizationWithQueryMode,
|
|
25
|
+
completeEaaUserAuthorizationWithQueryMode,
|
|
24
26
|
continueUserAuthorizationWithMRTDPoPChallenge,
|
|
25
27
|
getRequestedCredentialToBePresented,
|
|
26
28
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
@@ -9,6 +9,7 @@ export const mapToIssuerConfig = createMapper<
|
|
|
9
9
|
const {
|
|
10
10
|
oauth_authorization_server,
|
|
11
11
|
openid_credential_issuer,
|
|
12
|
+
openid_credential_verifier,
|
|
12
13
|
federation_entity,
|
|
13
14
|
} = x.payload.metadata;
|
|
14
15
|
return {
|
|
@@ -28,5 +29,9 @@ export const mapToIssuerConfig = createMapper<
|
|
|
28
29
|
openid_credential_issuer.status_attestation_endpoint,
|
|
29
30
|
nonce_endpoint: openid_credential_issuer.nonce_endpoint,
|
|
30
31
|
federation_entity,
|
|
32
|
+
encrypted_response_enc_values_supported:
|
|
33
|
+
openid_credential_verifier?.authorization_encrypted_response_enc
|
|
34
|
+
? [openid_credential_verifier.authorization_encrypted_response_enc]
|
|
35
|
+
: undefined,
|
|
31
36
|
};
|
|
32
37
|
});
|
|
@@ -88,7 +88,7 @@ export const startUserAuthorization: IssuanceApi["startUserAuthorization"] =
|
|
|
88
88
|
signJwt,
|
|
89
89
|
},
|
|
90
90
|
clientAttestation: walletInstanceAttestation,
|
|
91
|
-
authorizationServer: issuerConf.
|
|
91
|
+
authorizationServer: issuerConf.credential_issuer,
|
|
92
92
|
signer: wiaSigner,
|
|
93
93
|
jti: uuidv4(),
|
|
94
94
|
});
|
|
@@ -6,30 +6,33 @@ import {
|
|
|
6
6
|
import parseUrl from "parse-url";
|
|
7
7
|
import type { DcqlQuery } from "dcql";
|
|
8
8
|
import {
|
|
9
|
-
|
|
9
|
+
createAuthorizationResponse,
|
|
10
10
|
parseAuthorizeRequest,
|
|
11
|
+
fetchAuthorizationResponse,
|
|
12
|
+
type CreateAuthorizationResponseResult,
|
|
11
13
|
} from "@pagopa/io-wallet-oid4vp";
|
|
12
14
|
import { sendAuthorizationResponseAndExtractCode } from "@pagopa/io-wallet-oid4vci";
|
|
15
|
+
import type { jsonWebKeySet } from "@pagopa/io-wallet-oid-federation";
|
|
13
16
|
import { parseMrtdChallenge } from "@pagopa/io-wallet-oauth2";
|
|
14
|
-
import { SignJWT, type CryptoContext } from "@pagopa/io-react-native-jwt";
|
|
15
17
|
import { AuthorizationError, AuthorizationIdpError } from "../common/errors";
|
|
16
18
|
import { LogLevel, Logger } from "../../../utils/logging";
|
|
17
19
|
import { RemotePresentation as RemotePresentationFlow } from "../../presentation/v1.3.3";
|
|
18
|
-
import { partialCallbacks } from "../../../utils/callbacks";
|
|
19
|
-
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} from "../../../utils/
|
|
24
|
-
import
|
|
21
|
+
createVerifyJwtFromJwks,
|
|
22
|
+
partialCallbacks,
|
|
23
|
+
} from "../../../utils/callbacks";
|
|
24
|
+
import { sdkConfigV1_3, sdkConfigV1_4 } from "../../../utils/config";
|
|
25
|
+
import { IoWalletError, IssuerResponseError } from "../../../utils/errors";
|
|
26
|
+
import type { IssuanceApi, IssuerConfig } from "../api";
|
|
25
27
|
import { mapToRequestObject } from "./mappers";
|
|
26
|
-
import type {
|
|
28
|
+
import type { RequestObject } from "../../presentation";
|
|
29
|
+
import { hasStatusOrThrow } from "../../../utils/misc";
|
|
27
30
|
|
|
28
31
|
export const continueUserAuthorizationWithMRTDPoPChallenge: IssuanceApi["continueUserAuthorizationWithMRTDPoPChallenge"] =
|
|
29
32
|
async (authRedirectUrl) => {
|
|
30
33
|
Logger.log(
|
|
31
34
|
LogLevel.DEBUG,
|
|
32
|
-
|
|
35
|
+
"The requested credential is a PID and requires MRTD PoP, starting MRTD PoP validation from auth redirect"
|
|
33
36
|
);
|
|
34
37
|
try {
|
|
35
38
|
const parsedChallenge = parseMrtdChallenge({
|
|
@@ -65,11 +68,11 @@ export const buildAuthorizationUrl: IssuanceApi["buildAuthorizationUrl"] =
|
|
|
65
68
|
return { authUrl };
|
|
66
69
|
};
|
|
67
70
|
|
|
68
|
-
export const
|
|
71
|
+
export const completePidUserAuthorizationWithQueryMode: IssuanceApi["completePidUserAuthorizationWithQueryMode"] =
|
|
69
72
|
async (authRedirectUrl) => {
|
|
70
73
|
Logger.log(
|
|
71
74
|
LogLevel.DEBUG,
|
|
72
|
-
|
|
75
|
+
"The requested credential is a PID, completing the user authorization with query mode"
|
|
73
76
|
);
|
|
74
77
|
const query = parseUrl(authRedirectUrl).query;
|
|
75
78
|
|
|
@@ -80,7 +83,7 @@ export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCrede
|
|
|
80
83
|
async (issuerRequestUri, clientId, issuerConf, appFetch = fetch) => {
|
|
81
84
|
Logger.log(
|
|
82
85
|
LogLevel.DEBUG,
|
|
83
|
-
|
|
86
|
+
"The requested credential is not a PID, requesting the credential to be presented"
|
|
84
87
|
);
|
|
85
88
|
|
|
86
89
|
const authzRequestEndpoint = issuerConf.authorization_endpoint;
|
|
@@ -94,61 +97,39 @@ export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCrede
|
|
|
94
97
|
`Requesting the request object to ${authzRequestEndpoint}?${params.toString()}`
|
|
95
98
|
);
|
|
96
99
|
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
const requestObjectJwt = await appFetch(
|
|
101
|
+
`${authzRequestEndpoint}?${params.toString()}`,
|
|
102
|
+
{ method: "GET" }
|
|
103
|
+
)
|
|
104
|
+
.then(hasStatusOrThrow(200, IssuerResponseError))
|
|
105
|
+
.then((res) => res.text());
|
|
103
106
|
|
|
104
107
|
const parsedAuthRequest = await parseAuthorizeRequest({
|
|
105
108
|
config: sdkConfigV1_3,
|
|
106
|
-
requestObjectJwt
|
|
107
|
-
callbacks:
|
|
109
|
+
requestObjectJwt,
|
|
110
|
+
callbacks: {
|
|
111
|
+
verifyJwt: createVerifyJwtFromJwks(issuerConf.keys),
|
|
112
|
+
},
|
|
108
113
|
});
|
|
109
114
|
|
|
110
115
|
return mapToRequestObject(parsedAuthRequest);
|
|
111
116
|
};
|
|
112
117
|
|
|
118
|
+
// NOTE: this function is not used in the 1.3 issuance flow. It may be removed in the future.
|
|
113
119
|
export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["completeUserAuthorizationWithFormPostJwtMode"] =
|
|
114
|
-
async (
|
|
115
|
-
requestObject,
|
|
116
|
-
issuerConfig,
|
|
117
|
-
pid,
|
|
118
|
-
{ wiaCryptoContext, pidKeyTag, appFetch = fetch }
|
|
119
|
-
) => {
|
|
120
|
+
async (requestObject, issuerConfig, pid, { appFetch = fetch }) => {
|
|
120
121
|
Logger.log(
|
|
121
122
|
LogLevel.DEBUG,
|
|
122
|
-
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(
|
|
126
|
-
requestObject.dcql_query as DcqlQuery,
|
|
127
|
-
[[pidKeyTag, pid]]
|
|
123
|
+
"The requested credential is not a PID, completing the user authorization with form_post.jwt mode"
|
|
128
124
|
);
|
|
129
125
|
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const remotePresentation =
|
|
137
|
-
await RemotePresentationFlow.prepareRemotePresentations(
|
|
138
|
-
dcqlQueryResult,
|
|
139
|
-
authRequestObject
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
const authzResponsePayload = await createAuthzResponsePayload({
|
|
143
|
-
state: requestObject.state,
|
|
144
|
-
remotePresentation,
|
|
145
|
-
wiaCryptoContext,
|
|
126
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
127
|
+
requestObject,
|
|
128
|
+
issuerConfig,
|
|
129
|
+
pid,
|
|
146
130
|
});
|
|
147
131
|
|
|
148
|
-
Logger.log(
|
|
149
|
-
LogLevel.DEBUG,
|
|
150
|
-
`Authz response payload: ${authzResponsePayload}`
|
|
151
|
-
);
|
|
132
|
+
Logger.log(LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
152
133
|
|
|
153
134
|
const issuerSigKey = issuerConfig.keys.find((key) => key.use === "sig");
|
|
154
135
|
if (!issuerSigKey) {
|
|
@@ -158,13 +139,13 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
|
|
|
158
139
|
}
|
|
159
140
|
|
|
160
141
|
return sendAuthorizationResponseAndExtractCode({
|
|
161
|
-
authorizationResponseJarm:
|
|
142
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
162
143
|
callbacks: {
|
|
163
144
|
...partialCallbacks,
|
|
164
145
|
fetch: appFetch,
|
|
165
146
|
},
|
|
166
147
|
iss: requestObject.iss,
|
|
167
|
-
state: requestObject.state
|
|
148
|
+
state: requestObject.state ?? "",
|
|
168
149
|
presentationResponseUri: requestObject.response_uri,
|
|
169
150
|
signer: {
|
|
170
151
|
alg: "ES256",
|
|
@@ -174,6 +155,62 @@ export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["complete
|
|
|
174
155
|
});
|
|
175
156
|
};
|
|
176
157
|
|
|
158
|
+
export const completeEaaUserAuthorizationWithQueryMode: IssuanceApi["completeEaaUserAuthorizationWithQueryMode"] =
|
|
159
|
+
async (
|
|
160
|
+
requestObject,
|
|
161
|
+
issuerConfig,
|
|
162
|
+
pid,
|
|
163
|
+
clientRedirectUri,
|
|
164
|
+
{ appFetch = fetch } = {}
|
|
165
|
+
) => {
|
|
166
|
+
Logger.log(
|
|
167
|
+
LogLevel.DEBUG,
|
|
168
|
+
"The requested credential is not a PID, completing the user authorization with query mode"
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const authzResponse = await processPidPresentationAndCreateAuthzResponse({
|
|
172
|
+
requestObject,
|
|
173
|
+
issuerConfig,
|
|
174
|
+
pid,
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
Logger.log(LogLevel.DEBUG, `Authz response: ${authzResponse}`);
|
|
178
|
+
|
|
179
|
+
const { redirect_uri } = await fetchAuthorizationResponse({
|
|
180
|
+
authorizationResponseJarm: authzResponse.jarm.responseJwe,
|
|
181
|
+
presentationResponseUri: requestObject.response_uri,
|
|
182
|
+
callbacks: {
|
|
183
|
+
...partialCallbacks,
|
|
184
|
+
fetch: appFetch,
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
if (!redirect_uri) {
|
|
189
|
+
const errorMessage =
|
|
190
|
+
"The authorization server did not return a redirect_uri to continue the authorization flow";
|
|
191
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
192
|
+
throw new AuthorizationError(errorMessage);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const response = await appFetch(redirect_uri).catch(() => null);
|
|
196
|
+
|
|
197
|
+
if (!response || !response.ok) {
|
|
198
|
+
const errorMessage = `An error occurred while completing the authorization flow. Ensure ${clientRedirectUri} is a valid HTTP url for redirect`;
|
|
199
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
200
|
+
throw new AuthorizationError(errorMessage);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const finalRedirectUri = response.url;
|
|
204
|
+
|
|
205
|
+
if (!finalRedirectUri || !finalRedirectUri.startsWith(clientRedirectUri)) {
|
|
206
|
+
const errorMessage = `The authorization server did not redirect to the provided client redirect URI. Expected: ${clientRedirectUri}, got: ${finalRedirectUri}`;
|
|
207
|
+
Logger.log(LogLevel.ERROR, errorMessage);
|
|
208
|
+
throw new AuthorizationError(errorMessage);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return parseAuthorizationResponse(parseUrl(finalRedirectUri).query);
|
|
212
|
+
};
|
|
213
|
+
|
|
177
214
|
/**
|
|
178
215
|
* Parse the authorization response and return the result which contains code, state and iss.
|
|
179
216
|
* @throws {AuthorizationError} if an error occurs during the parsing process
|
|
@@ -207,45 +244,52 @@ export const parseAuthorizationResponse = (
|
|
|
207
244
|
};
|
|
208
245
|
|
|
209
246
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* @param
|
|
214
|
-
* @
|
|
215
|
-
* @returns The Base64 encoded authorization response payload.
|
|
247
|
+
* Utility function to process the DCQL query for PID presentation and to create the authorization response to send to the Issuer.
|
|
248
|
+
* @param params.requestObject - The request object containing the DCQL query
|
|
249
|
+
* @param params.issuerConfig - The Issuer unified configuration
|
|
250
|
+
* @param params.pid - The PID credential to be presented, as a tuple of [keyTag, credential]
|
|
251
|
+
* @returns The authorization response containing the JARM to be sent to the Issuer
|
|
216
252
|
*/
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
253
|
+
const processPidPresentationAndCreateAuthzResponse = async ({
|
|
254
|
+
requestObject,
|
|
255
|
+
issuerConfig,
|
|
256
|
+
pid,
|
|
221
257
|
}: {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}): Promise<
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
258
|
+
requestObject: RequestObject;
|
|
259
|
+
issuerConfig: IssuerConfig;
|
|
260
|
+
pid: [keyTag: string, credential: string];
|
|
261
|
+
}): Promise<CreateAuthorizationResponseResult> => {
|
|
262
|
+
const dcqlQueryResult = await RemotePresentationFlow.evaluateDcqlQuery(
|
|
263
|
+
requestObject.dcql_query as DcqlQuery,
|
|
264
|
+
[pid]
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
const remotePresentation =
|
|
268
|
+
await RemotePresentationFlow.prepareRemotePresentations(dcqlQueryResult, {
|
|
269
|
+
clientId: requestObject.client_id,
|
|
270
|
+
nonce: requestObject.nonce,
|
|
271
|
+
responseUri: requestObject.response_uri,
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const vp_token = remotePresentation.presentations.reduce(
|
|
275
|
+
(acc, { credentialId, vpToken }) => ({ ...acc, [credentialId]: [vpToken] }),
|
|
276
|
+
{} as Record<string, string[]>
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
return createAuthorizationResponse({
|
|
280
|
+
// The SDK 1.4 config is used here in order to resolve the encryption data from the Request Object
|
|
281
|
+
// client_metadata, otherwise OpenID Federation clients always ignore client_metadata as per 1.3.3 specs.
|
|
282
|
+
config: sdkConfigV1_4,
|
|
283
|
+
requestObject,
|
|
284
|
+
rpJwks: {
|
|
285
|
+
jwks: { keys: issuerConfig.keys } as jsonWebKeySet,
|
|
286
|
+
encrypted_response_enc_values_supported:
|
|
287
|
+
issuerConfig.encrypted_response_enc_values_supported,
|
|
288
|
+
},
|
|
289
|
+
vp_token,
|
|
290
|
+
callbacks: {
|
|
291
|
+
encryptJwe: partialCallbacks.encryptJwe,
|
|
292
|
+
generateRandom: partialCallbacks.generateRandom,
|
|
293
|
+
},
|
|
294
|
+
});
|
|
251
295
|
};
|
|
@@ -112,7 +112,7 @@ export const requestCredentials = async ({
|
|
|
112
112
|
},
|
|
113
113
|
clientId,
|
|
114
114
|
credential_identifier: credentialIdentifier,
|
|
115
|
-
issuerIdentifier: issuerConf.
|
|
115
|
+
issuerIdentifier: issuerConf.credential_endpoint,
|
|
116
116
|
maxBatchSize: issuerConf.credential_issuance_batch_size,
|
|
117
117
|
nonce: c_nonce,
|
|
118
118
|
keyAttestation: keyAttestationJwt,
|
|
@@ -3,7 +3,8 @@ import { evaluateIssuerTrust } from "./01-evaluate-issuer-trust";
|
|
|
3
3
|
import { startUserAuthorization } from "./02-start-user-authorization";
|
|
4
4
|
import {
|
|
5
5
|
continueUserAuthorizationWithMRTDPoPChallenge,
|
|
6
|
-
|
|
6
|
+
completePidUserAuthorizationWithQueryMode,
|
|
7
|
+
completeEaaUserAuthorizationWithQueryMode,
|
|
7
8
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
8
9
|
buildAuthorizationUrl,
|
|
9
10
|
getRequestedCredentialToBePresented,
|
|
@@ -20,7 +21,8 @@ export const Issuance: IssuanceApi = {
|
|
|
20
21
|
evaluateIssuerTrust,
|
|
21
22
|
startUserAuthorization,
|
|
22
23
|
buildAuthorizationUrl,
|
|
23
|
-
|
|
24
|
+
completePidUserAuthorizationWithQueryMode,
|
|
25
|
+
completeEaaUserAuthorizationWithQueryMode,
|
|
24
26
|
continueUserAuthorizationWithMRTDPoPChallenge,
|
|
25
27
|
getRequestedCredentialToBePresented,
|
|
26
28
|
completeUserAuthorizationWithFormPostJwtMode,
|
|
@@ -41,6 +41,7 @@ export const mapToIssuerConfig = createMapper<
|
|
|
41
41
|
const {
|
|
42
42
|
oauth_authorization_server,
|
|
43
43
|
openid_credential_issuer,
|
|
44
|
+
openid_credential_verifier,
|
|
44
45
|
federation_entity,
|
|
45
46
|
} = x.metadata;
|
|
46
47
|
|
|
@@ -67,10 +68,12 @@ export const mapToIssuerConfig = createMapper<
|
|
|
67
68
|
pushed_authorization_request_endpoint:
|
|
68
69
|
oauth_authorization_server.pushed_authorization_request_endpoint,
|
|
69
70
|
token_endpoint: oauth_authorization_server.token_endpoint,
|
|
70
|
-
nonce_endpoint: openid_credential_issuer.nonce_endpoint
|
|
71
|
+
nonce_endpoint: openid_credential_issuer.nonce_endpoint ?? "",
|
|
71
72
|
federation_entity: federation_entity ?? {},
|
|
72
73
|
credential_issuance_batch_size:
|
|
73
74
|
openid_credential_issuer.batch_credential_issuance?.batch_size,
|
|
75
|
+
encrypted_response_enc_values_supported:
|
|
76
|
+
openid_credential_verifier?.encrypted_response_enc_values_supported,
|
|
74
77
|
};
|
|
75
78
|
},
|
|
76
79
|
{ outputSchema: IssuerConfig } // Output validation for extra-safety
|
|
@@ -79,13 +82,9 @@ export const mapToIssuerConfig = createMapper<
|
|
|
79
82
|
export const mapToRequestObject = createMapper<
|
|
80
83
|
ParsedAuthorizeRequestResult,
|
|
81
84
|
RequestObject
|
|
82
|
-
>(({ payload }) => ({
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
response_uri: payload.response_uri,
|
|
88
|
-
state: payload.state,
|
|
89
|
-
response_mode: payload.response_mode,
|
|
90
|
-
response_type: payload.response_type,
|
|
85
|
+
>(({ header, payload }) => ({
|
|
86
|
+
...payload,
|
|
87
|
+
iss: payload.iss ?? "",
|
|
88
|
+
trust_chain: header.trust_chain,
|
|
89
|
+
x5c: header.x5c as string[] | undefined,
|
|
91
90
|
}));
|
|
@@ -7,7 +7,7 @@ export interface VerifyRequestObjectApi {
|
|
|
7
7
|
* @since 1.0.0
|
|
8
8
|
*
|
|
9
9
|
* @param requestObjectEncodedJwt The Request Object in JWT format
|
|
10
|
-
* @param params.clientId The client ID to verify
|
|
10
|
+
* @param params.clientId The client ID to verify (it may include a prefix)
|
|
11
11
|
* @param params.rpConf Optional Relying Party configuration (OpenID Federation clients only)
|
|
12
12
|
* @param params.state Optional state
|
|
13
13
|
* @returns The verified Request Object
|
|
@@ -72,13 +72,9 @@ export type RemotePresentationDetails = {
|
|
|
72
72
|
type ClientMetadata = {
|
|
73
73
|
jwks: jsonWebKeySet;
|
|
74
74
|
encrypted_response_enc_values_supported: string[];
|
|
75
|
-
client_id: string;
|
|
76
|
-
client_name: string;
|
|
77
|
-
logo_uri: string;
|
|
78
|
-
application_type: "web";
|
|
79
|
-
request_uris: string[];
|
|
80
|
-
response_uris: string[];
|
|
81
75
|
vp_formats_supported: Record<string, { "sd-jwt_alg_values"?: string[] }>;
|
|
76
|
+
client_name?: string;
|
|
77
|
+
logo_uri?: string;
|
|
82
78
|
};
|
|
83
79
|
|
|
84
80
|
/**
|
|
@@ -88,7 +84,7 @@ export type RequestObject = {
|
|
|
88
84
|
iss: string;
|
|
89
85
|
response_uri: string;
|
|
90
86
|
nonce: string;
|
|
91
|
-
state
|
|
87
|
+
state?: string;
|
|
92
88
|
client_id: string;
|
|
93
89
|
dcql_query: Record<string, unknown>;
|
|
94
90
|
response_type: "vp_token";
|
|
@@ -9,11 +9,11 @@ import type { DirectAuthorizationBodyPayload } from "../../v1.0.0/types";
|
|
|
9
9
|
* @returns A URL-encoded string suitable for an `application/x-www-form-urlencoded` POST body.
|
|
10
10
|
*/
|
|
11
11
|
export const buildDirectPostBody = async (
|
|
12
|
-
|
|
12
|
+
{ state }: RequestObject,
|
|
13
13
|
payload: DirectAuthorizationBodyPayload
|
|
14
14
|
): Promise<string> => {
|
|
15
15
|
const formUrlEncodedBody = new URLSearchParams({
|
|
16
|
-
state
|
|
16
|
+
...(state && { state }),
|
|
17
17
|
...Object.entries(payload).reduce(
|
|
18
18
|
(acc, [key, value]) => ({
|
|
19
19
|
...acc,
|
|
@@ -81,7 +81,7 @@ export const buildDirectPostJwtBody = async (
|
|
|
81
81
|
// Build the x-www-form-urlencoded form body
|
|
82
82
|
const formBody = new URLSearchParams({
|
|
83
83
|
response: encryptedResponse,
|
|
84
|
-
state: requestObject.state,
|
|
84
|
+
...(requestObject.state && { state: requestObject.state }),
|
|
85
85
|
});
|
|
86
86
|
return formBody.toString();
|
|
87
87
|
};
|
|
@@ -14,7 +14,7 @@ import { mapToRequestObject } from "./mappers";
|
|
|
14
14
|
import type { RawRequestObject } from "./types";
|
|
15
15
|
|
|
16
16
|
export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
17
|
-
async (requestObjectEncodedJwt, { clientId, rpConf }) => {
|
|
17
|
+
async (requestObjectEncodedJwt, { clientId: fullClientId, rpConf }) => {
|
|
18
18
|
const parsedRequestObject = await sdkParseAuthorizeRequest({
|
|
19
19
|
config: sdkConfigV1_3,
|
|
20
20
|
requestObjectJwt: requestObjectEncodedJwt,
|
|
@@ -25,17 +25,22 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
25
25
|
|
|
26
26
|
const rawRequestObject = parsedRequestObject as RawRequestObject;
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const { prefix, clientId } = extractClientIdPrefix(fullClientId);
|
|
29
29
|
|
|
30
|
-
if (
|
|
30
|
+
if (prefix === ClientIdPrefix.X509_HASH) {
|
|
31
31
|
validateX509HashClient(rawRequestObject.header.x5c, clientId);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
prefix === ClientIdPrefix.OPENID_FEDERATION ||
|
|
36
|
+
prefix === ClientIdPrefix.NONE
|
|
37
37
|
) {
|
|
38
|
-
validateOpenIDFederationClient(
|
|
38
|
+
validateOpenIDFederationClient(
|
|
39
|
+
rawRequestObject,
|
|
40
|
+
fullClientId,
|
|
41
|
+
clientId,
|
|
42
|
+
rpConf
|
|
43
|
+
);
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
return {
|
|
@@ -45,6 +50,7 @@ export const verifyRequestObject: RemotePresentationApi["verifyRequestObject"] =
|
|
|
45
50
|
|
|
46
51
|
const validateOpenIDFederationClient = (
|
|
47
52
|
requestObject: RawRequestObject,
|
|
53
|
+
fullClientId: string,
|
|
48
54
|
clientId: string,
|
|
49
55
|
rpConf: RelyingPartyConfig | undefined
|
|
50
56
|
) => {
|
|
@@ -55,8 +61,8 @@ const validateOpenIDFederationClient = (
|
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
const isClientIdMatch =
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
fullClientId === requestObject.payload.client_id &&
|
|
65
|
+
clientId === rpConf.subject;
|
|
60
66
|
|
|
61
67
|
if (!isClientIdMatch) {
|
|
62
68
|
throw new InvalidRequestObjectError(
|
|
@@ -67,10 +73,8 @@ const validateOpenIDFederationClient = (
|
|
|
67
73
|
|
|
68
74
|
const validateX509HashClient = (
|
|
69
75
|
certificateChain: string[],
|
|
70
|
-
|
|
76
|
+
x509Hash: string
|
|
71
77
|
) => {
|
|
72
|
-
const [, x509Hash] = clientId.split(":");
|
|
73
|
-
|
|
74
78
|
const calculatedHash = QuickCrypto.createHash("sha-256")
|
|
75
79
|
.update(certificateChain[0]!, "base64")
|
|
76
80
|
.digest("base64url");
|
|
@@ -81,6 +85,3 @@ const validateX509HashClient = (
|
|
|
81
85
|
);
|
|
82
86
|
}
|
|
83
87
|
};
|
|
84
|
-
|
|
85
|
-
const stripOpenIdFederationPrefix = (clientId: string) =>
|
|
86
|
-
clientId.replace("openid_federation:", "");
|
|
@@ -17,6 +17,7 @@ import { AuthorizationResponse } from "./types";
|
|
|
17
17
|
import { buildDirectPostBody } from "../common/utils/http";
|
|
18
18
|
import { prepareVpToken } from "../../../sd-jwt";
|
|
19
19
|
import { createCryptoContextFor } from "../../../utils/crypto";
|
|
20
|
+
import { sdkConfigV1_3 } from "../../../utils/config";
|
|
20
21
|
import { prepareVpTokenMdoc } from "../../../mdoc";
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -126,6 +127,7 @@ export const sendAuthorizationResponse: RemotePresentationApi["sendAuthorization
|
|
|
126
127
|
);
|
|
127
128
|
|
|
128
129
|
const { jarm } = await sdkCreateAuthorizationResponse({
|
|
130
|
+
config: sdkConfigV1_3,
|
|
129
131
|
requestObject,
|
|
130
132
|
rpJwks,
|
|
131
133
|
vp_token,
|
|
@@ -21,7 +21,7 @@ export const mapToRelyingPartyConfig = createMapper<
|
|
|
21
21
|
|
|
22
22
|
export const mapToRequestObject = createMapper<RawRequestObject, RequestObject>(
|
|
23
23
|
({ payload, header }) => ({
|
|
24
|
-
iss: payload.iss,
|
|
24
|
+
iss: payload.iss ?? "",
|
|
25
25
|
client_id: payload.client_id,
|
|
26
26
|
dcql_query: payload.dcql_query,
|
|
27
27
|
nonce: payload.nonce,
|