@idp.global/sdk 19.5.0 → 19.6.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/changelog.md +34 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts_relyingparty/classes.idpoidcprovider.d.ts +69 -11
- package/dist_ts_relyingparty/classes.idpoidcprovider.js +127 -17
- package/dist_ts_relyingparty/classes.relyingpartysessions.d.ts +67 -12
- package/dist_ts_relyingparty/classes.relyingpartysessions.js +179 -41
- package/dist_ts_relyingparty/classes.rpmodels.d.ts +21 -4
- package/dist_ts_relyingparty/classes.rpmodels.js +35 -8
- package/dist_ts_relyingparty/helpers.cookies.d.ts +6 -0
- package/dist_ts_relyingparty/helpers.cookies.js +8 -1
- package/dist_ts_relyingparty/interfaces.d.ts +31 -0
- package/dist_ts_relyingparty/testing.js +8 -4
- package/package.json +3 -3
- package/readme.md +132 -32
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts_relyingparty/classes.idpoidcprovider.ts +183 -17
- package/ts_relyingparty/classes.relyingpartysessions.ts +225 -44
- package/ts_relyingparty/classes.rpmodels.ts +27 -4
- package/ts_relyingparty/helpers.cookies.ts +13 -0
- package/ts_relyingparty/interfaces.ts +32 -0
- package/ts_relyingparty/testing.ts +7 -3
|
@@ -231,16 +231,20 @@ export class RelyingPartyProviderDouble implements IOidcProvider {
|
|
|
231
231
|
|
|
232
232
|
public async completeAuthorization(optionsArg: IOidcCompletionOptions): Promise<IOidcCompletion> {
|
|
233
233
|
if (!this.#discovered) {
|
|
234
|
-
throw new OidcCompletionError('token_exchange', notDiscovered());
|
|
234
|
+
throw new OidcCompletionError('token_exchange', notDiscovered(), { code: 'provider_unreachable' });
|
|
235
235
|
}
|
|
236
236
|
const code = optionsArg.callbackUrl.searchParams.get('code') ?? '';
|
|
237
237
|
const issued = this.#codes.get(code);
|
|
238
238
|
this.#codes.delete(code);
|
|
239
239
|
if (!issued || issued.state !== optionsArg.state) {
|
|
240
|
-
|
|
240
|
+
// what idp.global's token endpoint answers for such a code
|
|
241
|
+
throw new OidcCompletionError('token_exchange', new Error('unknown, used or foreign code'), {
|
|
242
|
+
code: 'token_exchange_refused',
|
|
243
|
+
oauthError: 'invalid_grant',
|
|
244
|
+
});
|
|
241
245
|
}
|
|
242
246
|
if (issued.nonce !== optionsArg.nonce) {
|
|
243
|
-
throw new OidcCompletionError('token_validation', new Error('nonce mismatch'));
|
|
247
|
+
throw new OidcCompletionError('token_validation', new Error('nonce mismatch'), { code: 'login_mismatch' });
|
|
244
248
|
}
|
|
245
249
|
this.completions.push({ subject: issued.subject, state: issued.state });
|
|
246
250
|
if (this.completionFailure) {
|