@axa-fr/oidc-client 7.22.18 → 7.22.19
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 +31 -39
- package/bin/copy-service-worker-files.mjs +24 -17
- package/dist/OidcTrustedDomains.js +14 -12
- package/dist/cache.d.ts.map +1 -1
- package/dist/checkSession.d.ts +1 -1
- package/dist/checkSession.d.ts.map +1 -1
- package/dist/checkSessionIFrame.d.ts.map +1 -1
- package/dist/crypto.d.ts.map +1 -1
- package/dist/fetch.d.ts +2 -1
- package/dist/fetch.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +935 -601
- package/dist/index.umd.cjs +2 -2
- package/dist/initSession.d.ts +1 -1
- package/dist/initSession.d.ts.map +1 -1
- package/dist/initWorker.d.ts +2 -2
- package/dist/initWorker.d.ts.map +1 -1
- package/dist/initWorkerOption.d.ts.map +1 -1
- package/dist/jwt.d.ts +2 -2
- package/dist/jwt.d.ts.map +1 -1
- package/dist/keepSession.d.ts.map +1 -1
- package/dist/location.d.ts.map +1 -1
- package/dist/login.d.ts +1 -1
- package/dist/login.d.ts.map +1 -1
- package/dist/logout.d.ts +1 -1
- package/dist/logout.d.ts.map +1 -1
- package/dist/oidc.d.ts +1 -1
- package/dist/oidc.d.ts.map +1 -1
- package/dist/oidcClient.d.ts +2 -2
- package/dist/oidcClient.d.ts.map +1 -1
- package/dist/parseTokens.d.ts.map +1 -1
- package/dist/renewTokens.d.ts.map +1 -1
- package/dist/requests.d.ts +1 -1
- package/dist/requests.d.ts.map +1 -1
- package/dist/silentLogin.d.ts.map +1 -1
- package/dist/timer.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/user.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/cache.ts +21 -18
- package/src/checkSession.ts +89 -54
- package/src/checkSessionIFrame.ts +70 -69
- package/src/crypto.ts +27 -25
- package/src/events.ts +28 -28
- package/src/fetch.ts +40 -21
- package/src/index.ts +6 -17
- package/src/iniWorker.spec.ts +26 -16
- package/src/initSession.ts +115 -113
- package/src/initWorker.ts +299 -212
- package/src/initWorkerOption.ts +121 -114
- package/src/jwt.ts +150 -136
- package/src/keepSession.ts +100 -81
- package/src/location.ts +24 -26
- package/src/login.ts +246 -189
- package/src/logout.spec.ts +131 -76
- package/src/logout.ts +130 -115
- package/src/oidc.ts +426 -337
- package/src/oidcClient.ts +129 -105
- package/src/parseTokens.spec.ts +198 -179
- package/src/parseTokens.ts +221 -186
- package/src/renewTokens.ts +397 -284
- package/src/requests.spec.ts +5 -7
- package/src/requests.ts +142 -114
- package/src/route-utils.spec.ts +17 -19
- package/src/route-utils.ts +29 -26
- package/src/silentLogin.ts +145 -127
- package/src/timer.ts +10 -11
- package/src/types.ts +56 -46
- package/src/user.ts +17 -12
- package/src/version.ts +1 -1
package/src/login.ts
CHANGED
|
@@ -1,221 +1,278 @@
|
|
|
1
|
-
import {generateRandom} from './crypto.js';
|
|
2
|
-
import {eventNames} from './events.js';
|
|
3
|
-
import {initSession} from './initSession.js';
|
|
4
|
-
import {initWorkerAsync} from './initWorker.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from './requests.js';
|
|
10
|
-
import {getParseQueryStringFromLocation} from './route-utils.js';
|
|
11
|
-
import {OidcConfiguration, StringMap} from './types.js';
|
|
12
|
-
import {generateJwkAsync, generateJwtDemonstratingProofOfPossessionAsync} from "./jwt";
|
|
13
|
-
import {ILOidcLocation} from "./location";
|
|
14
|
-
import Oidc from "./oidc";
|
|
1
|
+
import { generateRandom } from './crypto.js';
|
|
2
|
+
import { eventNames } from './events.js';
|
|
3
|
+
import { initSession } from './initSession.js';
|
|
4
|
+
import { initWorkerAsync } from './initWorker.js';
|
|
5
|
+
import { generateJwkAsync, generateJwtDemonstratingProofOfPossessionAsync } from './jwt';
|
|
6
|
+
import { ILOidcLocation } from './location';
|
|
7
|
+
import Oidc from './oidc';
|
|
8
|
+
import { isTokensOidcValid } from './parseTokens.js';
|
|
9
|
+
import { performAuthorizationRequestAsync, performFirstTokenRequestAsync } from './requests.js';
|
|
10
|
+
import { getParseQueryStringFromLocation } from './route-utils.js';
|
|
11
|
+
import { OidcConfiguration, StringMap } from './types.js';
|
|
15
12
|
|
|
16
13
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
17
|
-
export const defaultLoginAsync =
|
|
14
|
+
export const defaultLoginAsync =
|
|
15
|
+
(
|
|
16
|
+
configurationName: string,
|
|
17
|
+
configuration: OidcConfiguration,
|
|
18
|
+
publishEvent: (string, any) => void,
|
|
19
|
+
initAsync: Function,
|
|
20
|
+
oidcLocation: ILOidcLocation,
|
|
21
|
+
) =>
|
|
22
|
+
(
|
|
23
|
+
callbackPath: string = undefined,
|
|
24
|
+
extras: StringMap = null,
|
|
25
|
+
isSilentSignin = false,
|
|
26
|
+
scope: string = undefined,
|
|
27
|
+
) => {
|
|
18
28
|
const originExtras = extras;
|
|
19
29
|
extras = { ...extras };
|
|
20
30
|
const loginLocalAsync = async () => {
|
|
21
|
-
|
|
31
|
+
const url = callbackPath || oidcLocation.getPath();
|
|
22
32
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
if (!('state' in extras)) {
|
|
34
|
+
extras.state = generateRandom(16);
|
|
35
|
+
}
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
37
|
+
publishEvent(eventNames.loginAsync_begin, {});
|
|
38
|
+
if (extras) {
|
|
39
|
+
for (const key of Object.keys(extras)) {
|
|
40
|
+
if (key.endsWith(':token_request')) {
|
|
41
|
+
delete extras[key];
|
|
42
|
+
}
|
|
34
43
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (!extraFinal.nonce) {
|
|
43
|
-
extraFinal.nonce = generateRandom(12);
|
|
44
|
-
}
|
|
45
|
-
const nonce = { nonce: extraFinal.nonce };
|
|
46
|
-
const serviceWorker = await initWorkerAsync(configuration, configurationName);
|
|
47
|
-
const oidcServerConfiguration = await initAsync(configuration.authority, configuration.authority_configuration);
|
|
48
|
-
let storage;
|
|
49
|
-
if (serviceWorker) {
|
|
50
|
-
serviceWorker.setLoginParams({ callbackPath: url, extras: originExtras });
|
|
51
|
-
await serviceWorker.initAsync(oidcServerConfiguration, 'loginAsync', configuration);
|
|
52
|
-
await serviceWorker.setNonceAsync(nonce);
|
|
53
|
-
serviceWorker.startKeepAliveServiceWorker();
|
|
54
|
-
storage = serviceWorker;
|
|
55
|
-
} else {
|
|
56
|
-
const session = initSession(configurationName, configuration.storage ?? sessionStorage);
|
|
57
|
-
session.setLoginParams({ callbackPath: url, extras: originExtras });
|
|
58
|
-
await session.setNonceAsync(nonce);
|
|
59
|
-
storage = session;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
const extraInternal = {
|
|
64
|
-
client_id: configuration.client_id,
|
|
65
|
-
redirect_uri: redirectUri,
|
|
66
|
-
scope,
|
|
67
|
-
response_type: 'code',
|
|
68
|
-
...extraFinal,
|
|
69
|
-
};
|
|
70
|
-
await performAuthorizationRequestAsync(storage, oidcLocation)(oidcServerConfiguration.authorizationEndpoint, extraInternal);
|
|
71
|
-
} catch (exception) {
|
|
72
|
-
publishEvent(eventNames.loginAsync_error, exception);
|
|
73
|
-
throw exception;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
const redirectUri = isSilentSignin
|
|
47
|
+
? configuration.silent_redirect_uri
|
|
48
|
+
: configuration.redirect_uri;
|
|
49
|
+
if (!scope) {
|
|
50
|
+
scope = configuration.scope;
|
|
74
51
|
}
|
|
75
|
-
};
|
|
76
|
-
return loginLocalAsync();
|
|
77
|
-
};
|
|
78
52
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const queryParams = getParseQueryStringFromLocation(href);
|
|
90
|
-
const sessionState = queryParams.session_state;
|
|
91
|
-
const serviceWorker = await initWorkerAsync(configuration, oidc.configurationName);
|
|
53
|
+
const extraFinal = !configuration.extras ? extras : { ...configuration.extras, ...extras };
|
|
54
|
+
if (!extraFinal.nonce) {
|
|
55
|
+
extraFinal.nonce = generateRandom(12);
|
|
56
|
+
}
|
|
57
|
+
const nonce = { nonce: extraFinal.nonce };
|
|
58
|
+
const serviceWorker = await initWorkerAsync(configuration, configurationName);
|
|
59
|
+
const oidcServerConfiguration = await initAsync(
|
|
60
|
+
configuration.authority,
|
|
61
|
+
configuration.authority_configuration,
|
|
62
|
+
);
|
|
92
63
|
let storage;
|
|
93
|
-
let nonceData;
|
|
94
|
-
let getLoginParams;
|
|
95
|
-
let state;
|
|
96
64
|
if (serviceWorker) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
serviceWorker.startKeepAliveServiceWorker();
|
|
103
|
-
storage = serviceWorker;
|
|
65
|
+
serviceWorker.setLoginParams({ callbackPath: url, extras: originExtras });
|
|
66
|
+
await serviceWorker.initAsync(oidcServerConfiguration, 'loginAsync', configuration);
|
|
67
|
+
await serviceWorker.setNonceAsync(nonce);
|
|
68
|
+
serviceWorker.startKeepAliveServiceWorker();
|
|
69
|
+
storage = serviceWorker;
|
|
104
70
|
} else {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
state = await session.getStateAsync();
|
|
110
|
-
storage = session;
|
|
71
|
+
const session = initSession(configurationName, configuration.storage ?? sessionStorage);
|
|
72
|
+
session.setLoginParams({ callbackPath: url, extras: originExtras });
|
|
73
|
+
await session.setNonceAsync(nonce);
|
|
74
|
+
storage = session;
|
|
111
75
|
}
|
|
112
76
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
const extraInternal = {
|
|
79
|
+
client_id: configuration.client_id,
|
|
80
|
+
redirect_uri: redirectUri,
|
|
81
|
+
scope,
|
|
82
|
+
response_type: 'code',
|
|
83
|
+
...extraFinal,
|
|
84
|
+
};
|
|
85
|
+
await performAuthorizationRequestAsync(storage, oidcLocation)(
|
|
86
|
+
oidcServerConfiguration.authorizationEndpoint,
|
|
87
|
+
extraInternal,
|
|
88
|
+
);
|
|
89
|
+
} catch (exception) {
|
|
90
|
+
publishEvent(eventNames.loginAsync_error, exception);
|
|
91
|
+
throw exception;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return loginLocalAsync();
|
|
95
|
+
};
|
|
118
96
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
97
|
+
export const loginCallbackAsync =
|
|
98
|
+
(oidc: Oidc) =>
|
|
99
|
+
async (isSilentSignin = false) => {
|
|
100
|
+
try {
|
|
101
|
+
oidc.publishEvent(eventNames.loginCallbackAsync_begin, {});
|
|
102
|
+
const configuration = oidc.configuration;
|
|
103
|
+
const clientId = configuration.client_id;
|
|
104
|
+
const redirectUri = isSilentSignin
|
|
105
|
+
? configuration.silent_redirect_uri
|
|
106
|
+
: configuration.redirect_uri;
|
|
107
|
+
const authority = configuration.authority;
|
|
108
|
+
const tokenRequestTimeout = configuration.token_request_timeout;
|
|
109
|
+
const oidcServerConfiguration = await oidc.initAsync(
|
|
110
|
+
authority,
|
|
111
|
+
configuration.authority_configuration,
|
|
112
|
+
);
|
|
113
|
+
const href = oidc.location.getCurrentHref();
|
|
114
|
+
const queryParams = getParseQueryStringFromLocation(href);
|
|
115
|
+
const sessionState = queryParams.session_state;
|
|
116
|
+
const serviceWorker = await initWorkerAsync(configuration, oidc.configurationName);
|
|
117
|
+
let storage;
|
|
118
|
+
let nonceData;
|
|
119
|
+
let getLoginParams;
|
|
120
|
+
let state;
|
|
121
|
+
if (serviceWorker) {
|
|
122
|
+
await serviceWorker.initAsync(oidcServerConfiguration, 'loginCallbackAsync', configuration);
|
|
123
|
+
await serviceWorker.setSessionStateAsync(sessionState);
|
|
124
|
+
nonceData = await serviceWorker.getNonceAsync();
|
|
125
|
+
getLoginParams = serviceWorker.getLoginParams();
|
|
126
|
+
state = await serviceWorker.getStateAsync();
|
|
127
|
+
serviceWorker.startKeepAliveServiceWorker();
|
|
128
|
+
storage = serviceWorker;
|
|
129
|
+
} else {
|
|
130
|
+
const session = initSession(
|
|
131
|
+
oidc.configurationName,
|
|
132
|
+
configuration.storage ?? sessionStorage,
|
|
133
|
+
);
|
|
134
|
+
await session.setSessionStateAsync(sessionState);
|
|
135
|
+
nonceData = await session.getNonceAsync();
|
|
136
|
+
getLoginParams = session.getLoginParams();
|
|
137
|
+
state = await session.getStateAsync();
|
|
138
|
+
storage = session;
|
|
139
|
+
}
|
|
126
140
|
|
|
127
|
-
|
|
128
|
-
code: params.code,
|
|
129
|
-
grant_type: 'authorization_code',
|
|
130
|
-
client_id: configuration.client_id,
|
|
131
|
-
redirect_uri: redirectUri,
|
|
132
|
-
};
|
|
141
|
+
const params = getParseQueryStringFromLocation(href);
|
|
133
142
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
143
|
+
if (params.error || params.error_description) {
|
|
144
|
+
throw new Error(`Error from OIDC server: ${params.error} - ${params.error_description}`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (params.iss && params.iss !== oidcServerConfiguration.issuer) {
|
|
148
|
+
console.error();
|
|
149
|
+
throw new Error(
|
|
150
|
+
`Issuer not valid (expected: ${oidcServerConfiguration.issuer}, received: ${params.iss})`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
if (params.state && params.state !== state) {
|
|
154
|
+
throw new Error(`State not valid (expected: ${state}, received: ${params.state})`);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const data = {
|
|
158
|
+
code: params.code,
|
|
159
|
+
grant_type: 'authorization_code',
|
|
160
|
+
client_id: configuration.client_id,
|
|
161
|
+
redirect_uri: redirectUri,
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const extras = {};
|
|
165
|
+
// @ts-ignore
|
|
166
|
+
if (configuration.token_request_extras) {
|
|
167
|
+
for (const [key, value] of Object.entries(configuration.token_request_extras)) {
|
|
168
|
+
extras[key] = value;
|
|
140
169
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
170
|
+
}
|
|
171
|
+
if (getLoginParams && getLoginParams.extras) {
|
|
172
|
+
for (const [key, value] of Object.entries(getLoginParams.extras)) {
|
|
173
|
+
if (key.endsWith(':token_request')) {
|
|
174
|
+
extras[key.replace(':token_request', '')] = value;
|
|
175
|
+
}
|
|
147
176
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const url = oidcServerConfiguration.tokenEndpoint;
|
|
180
|
+
const headersExtras = {};
|
|
181
|
+
if (configuration.demonstrating_proof_of_possession) {
|
|
182
|
+
if (serviceWorker) {
|
|
183
|
+
headersExtras['DPoP'] = `DPOP_SECURED_BY_OIDC_SERVICE_WORKER_${oidc.configurationName}`;
|
|
184
|
+
} else {
|
|
185
|
+
const jwk = await generateJwkAsync(window)(
|
|
186
|
+
configuration.demonstrating_proof_of_possession_configuration.generateKeyAlgorithm,
|
|
187
|
+
);
|
|
188
|
+
const session = initSession(oidc.configurationName, configuration.storage);
|
|
189
|
+
await session.setDemonstratingProofOfPossessionJwkAsync(jwk);
|
|
190
|
+
headersExtras['DPoP'] = await generateJwtDemonstratingProofOfPossessionAsync(window)(
|
|
191
|
+
configuration.demonstrating_proof_of_possession_configuration,
|
|
192
|
+
)(jwk, 'POST', url);
|
|
160
193
|
}
|
|
194
|
+
}
|
|
161
195
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
196
|
+
const tokenResponse = await performFirstTokenRequestAsync(storage)(
|
|
197
|
+
url,
|
|
198
|
+
{ ...data, ...extras },
|
|
199
|
+
headersExtras,
|
|
200
|
+
oidc.configuration.token_renew_mode,
|
|
201
|
+
tokenRequestTimeout,
|
|
202
|
+
);
|
|
167
203
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
204
|
+
if (!tokenResponse.success) {
|
|
205
|
+
throw new Error('Token request failed');
|
|
206
|
+
}
|
|
171
207
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
208
|
+
let loginParams;
|
|
209
|
+
const formattedTokens = tokenResponse.data.tokens;
|
|
210
|
+
const demonstratingProofOfPossessionNonce =
|
|
211
|
+
tokenResponse.data.demonstratingProofOfPossessionNonce;
|
|
175
212
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
213
|
+
// @ts-ignore
|
|
214
|
+
if (tokenResponse.data.state !== extras.state) {
|
|
215
|
+
throw new Error('state is not valid');
|
|
216
|
+
}
|
|
217
|
+
const { isValid, reason } = isTokensOidcValid(
|
|
218
|
+
formattedTokens,
|
|
219
|
+
nonceData.nonce,
|
|
220
|
+
oidcServerConfiguration,
|
|
221
|
+
);
|
|
222
|
+
if (!isValid) {
|
|
223
|
+
throw new Error(`Tokens are not OpenID valid, reason: ${reason}`);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (serviceWorker) {
|
|
227
|
+
if (
|
|
228
|
+
formattedTokens.refreshToken &&
|
|
229
|
+
!formattedTokens.refreshToken.includes('SECURED_BY_OIDC_SERVICE_WORKER')
|
|
230
|
+
) {
|
|
231
|
+
throw new Error('Refresh token should be hidden by service worker');
|
|
179
232
|
}
|
|
180
|
-
|
|
181
|
-
if (
|
|
182
|
-
|
|
233
|
+
|
|
234
|
+
if (
|
|
235
|
+
demonstratingProofOfPossessionNonce &&
|
|
236
|
+
formattedTokens.accessToken &&
|
|
237
|
+
formattedTokens.accessToken.includes('SECURED_BY_OIDC_SERVICE_WORKER')
|
|
238
|
+
) {
|
|
239
|
+
throw new Error(
|
|
240
|
+
'Demonstration of proof of possession require Access token not hidden by service worker',
|
|
241
|
+
);
|
|
183
242
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (serviceWorker) {
|
|
246
|
+
await serviceWorker.initAsync(oidcServerConfiguration, 'syncTokensAsync', configuration);
|
|
247
|
+
loginParams = serviceWorker.getLoginParams();
|
|
248
|
+
if (demonstratingProofOfPossessionNonce) {
|
|
249
|
+
await serviceWorker.setDemonstratingProofOfPossessionNonce(
|
|
250
|
+
demonstratingProofOfPossessionNonce,
|
|
251
|
+
);
|
|
193
252
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
await serviceWorker.setDemonstratingProofOfPossessionNonce(demonstratingProofOfPossessionNonce);
|
|
200
|
-
}
|
|
201
|
-
} else {
|
|
202
|
-
const session = initSession(oidc.configurationName, configuration.storage);
|
|
203
|
-
loginParams = session.getLoginParams();
|
|
204
|
-
if(demonstratingProofOfPossessionNonce) {
|
|
205
|
-
await session.setDemonstratingProofOfPossessionNonce(demonstratingProofOfPossessionNonce);
|
|
206
|
-
}
|
|
253
|
+
} else {
|
|
254
|
+
const session = initSession(oidc.configurationName, configuration.storage);
|
|
255
|
+
loginParams = session.getLoginParams();
|
|
256
|
+
if (demonstratingProofOfPossessionNonce) {
|
|
257
|
+
await session.setDemonstratingProofOfPossessionNonce(demonstratingProofOfPossessionNonce);
|
|
207
258
|
}
|
|
259
|
+
}
|
|
208
260
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
261
|
+
await oidc.startCheckSessionAsync(
|
|
262
|
+
oidcServerConfiguration.checkSessionIframe,
|
|
263
|
+
clientId,
|
|
264
|
+
sessionState,
|
|
265
|
+
isSilentSignin,
|
|
266
|
+
);
|
|
267
|
+
oidc.publishEvent(eventNames.loginCallbackAsync_end, {});
|
|
268
|
+
return {
|
|
269
|
+
tokens: formattedTokens,
|
|
270
|
+
state: 'request.state',
|
|
271
|
+
callbackPath: loginParams.callbackPath,
|
|
272
|
+
};
|
|
216
273
|
} catch (exception) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
274
|
+
console.error(exception);
|
|
275
|
+
oidc.publishEvent(eventNames.loginCallbackAsync_error, exception);
|
|
276
|
+
throw exception;
|
|
220
277
|
}
|
|
221
|
-
};
|
|
278
|
+
};
|