@axa-fr/oidc-client 7.29.7 → 7.30.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 +226 -0
- package/dist/events.d.ts +3 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/fetch.d.ts +2 -2
- package/dist/fetch.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1353 -873
- package/dist/index.umd.cjs +2 -2
- package/dist/initSession.d.ts +2 -0
- package/dist/initSession.d.ts.map +1 -1
- package/dist/initWorker.d.ts +1 -25
- package/dist/initWorker.d.ts.map +1 -1
- package/dist/jwt.d.ts.map +1 -1
- package/dist/legacyCompatibility.spec.d.ts +2 -0
- package/dist/legacyCompatibility.spec.d.ts.map +1 -0
- package/dist/login.d.ts +2 -1
- package/dist/login.d.ts.map +1 -1
- package/dist/logout.d.ts.map +1 -1
- package/dist/node_modules/@axa-fr/oidc-client-service-worker/dist/OidcServiceWorker.js +1049 -0
- package/dist/node_modules/@axa-fr/oidc-client-service-worker/dist/OidcTrustedDomains.js +31 -0
- package/dist/oidc.d.ts +6 -1
- package/dist/oidc.d.ts.map +1 -1
- package/dist/oidcClient.d.ts +13 -2
- package/dist/oidcClient.d.ts.map +1 -1
- package/dist/oidcError.d.ts +5 -0
- package/dist/oidcError.d.ts.map +1 -1
- package/dist/parseTokens.d.ts +10 -0
- package/dist/parseTokens.d.ts.map +1 -1
- package/dist/protocol.d.ts +7 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/renewTokens.d.ts +0 -6
- package/dist/renewTokens.d.ts.map +1 -1
- package/dist/requests.d.ts +3 -3
- package/dist/requests.d.ts.map +1 -1
- package/dist/resourceParameters.d.ts +9 -0
- package/dist/resourceParameters.d.ts.map +1 -0
- package/dist/resourceTokens.d.ts +34 -0
- package/dist/resourceTokens.d.ts.map +1 -0
- package/dist/resourceTokens.spec.d.ts +2 -0
- package/dist/resourceTokens.spec.d.ts.map +1 -0
- package/dist/silentLogin.d.ts +2 -1
- package/dist/silentLogin.d.ts.map +1 -1
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/events.ts +3 -0
- package/src/fetch.ts +115 -15
- package/src/index.ts +4 -0
- package/src/initSession.ts +9 -0
- package/src/initWorker.ts +65 -13
- package/src/jwt.spec.ts +17 -0
- package/src/jwt.ts +4 -1
- package/src/legacyCompatibility.spec.ts +142 -0
- package/src/login.ts +91 -29
- package/src/logout.ts +36 -0
- package/src/oidc.ts +71 -20
- package/src/oidcClient.ts +48 -3
- package/src/oidcError.ts +7 -0
- package/src/parseTokens.ts +14 -1
- package/src/protocol.ts +16 -1
- package/src/renewTokens.ts +32 -16
- package/src/renewTokensError.spec.ts +111 -0
- package/src/requests.ts +13 -11
- package/src/resourceParameters.ts +85 -0
- package/src/resourceTokens.spec.ts +1271 -0
- package/src/resourceTokens.ts +708 -0
- package/src/silentLogin.spec.ts +87 -1
- package/src/silentLogin.ts +24 -22
- package/src/types.ts +34 -0
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ For React applications, use [`@axa-fr/react-oidc`](../react-oidc/README.md).
|
|
|
8
8
|
- [Service worker](#service-worker)
|
|
9
9
|
- [Configuration](#configuration)
|
|
10
10
|
- [Token renewal](#token-renewal)
|
|
11
|
+
- [Resource indicators and multiple APIs](#resource-indicators-and-multiple-apis)
|
|
11
12
|
- [Pushed Authorization Requests (PAR)](#pushed-authorization-requests-par)
|
|
12
13
|
- [DPoP](#dpop)
|
|
13
14
|
- [API](#api)
|
|
@@ -104,6 +105,165 @@ const profile = await response.json();
|
|
|
104
105
|
|
|
105
106
|
The wrapper attaches an access token, or a token placeholder when the service worker hides it, and integrates with token renewal. Only use it for API URLs you trust: the wrapper itself is not a destination allowlist. HTTP error responses still need an explicit `response.ok` check.
|
|
106
107
|
|
|
108
|
+
## Resource indicators and multiple APIs
|
|
109
|
+
|
|
110
|
+
For a runnable multi-API example, use the [local OpenIddict demos](../../examples/openiddict-server/README.md).
|
|
111
|
+
They exercise resource isolation, shared refresh rotation and DPoP in browser and
|
|
112
|
+
worker modes. Concurrent login requests retain one transaction while resource
|
|
113
|
+
entries are cleared, and silent authorization failures before redirect are
|
|
114
|
+
reported to the parent instead of becoming timeout-only errors.
|
|
115
|
+
|
|
116
|
+
The additive `resource` option supports one absolute URI or an array of URIs.
|
|
117
|
+
The client sends repeated `resource` parameters in authorization, PAR, code
|
|
118
|
+
exchange, and refresh requests, preserving the existing scope encoding.
|
|
119
|
+
Use `resources` to register each managed resource exactly once and specify its
|
|
120
|
+
permitted API URL prefixes. A resource is an API identifier, not a scope.
|
|
121
|
+
|
|
122
|
+
Clients without a resource registry retain the existing callback, custom-storage,
|
|
123
|
+
fetch and local-session-clearing paths. Resource transaction bookkeeping uses
|
|
124
|
+
native tab-scoped `sessionStorage`; configuring custom storage does not remove
|
|
125
|
+
that requirement when opting into resource management.
|
|
126
|
+
|
|
127
|
+
This example is illustrative: replace the issuer, resource identifiers,
|
|
128
|
+
audiences, scopes, and callback routes with values supported by your provider.
|
|
129
|
+
It does not claim that the hosted demo providers support RFC 8707.
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import { OidcClient, type OidcConfiguration } from '@axa-fr/oidc-client';
|
|
133
|
+
|
|
134
|
+
const ordersResource = 'https://orders.example.com';
|
|
135
|
+
const inventoryResource = 'https://inventory.example.com';
|
|
136
|
+
const configuration: OidcConfiguration = {
|
|
137
|
+
authority: 'https://issuer.example.com',
|
|
138
|
+
client_id: 'your-public-client',
|
|
139
|
+
redirect_uri: `${window.location.origin}/authentication/callback`,
|
|
140
|
+
silent_redirect_uri: `${window.location.origin}/authentication/silent-callback`,
|
|
141
|
+
silent_login_uri: `${window.location.origin}/authentication/silent-login`,
|
|
142
|
+
scope: 'openid profile offline_access orders.read inventory.read',
|
|
143
|
+
resource: [ordersResource, inventoryResource],
|
|
144
|
+
resources: [
|
|
145
|
+
{
|
|
146
|
+
resource: ordersResource,
|
|
147
|
+
allowedUrlPrefixes: ['https://orders.example.com/v1'],
|
|
148
|
+
scope: 'orders.read',
|
|
149
|
+
audiences: ['orders-api'],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
resource: inventoryResource,
|
|
153
|
+
allowedUrlPrefixes: ['https://inventory.example.com/v1'],
|
|
154
|
+
scope: 'inventory.read',
|
|
155
|
+
audiences: ['inventory-api'],
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
};
|
|
159
|
+
const oidcClient = OidcClient.getOrCreate(() => fetch)(configuration);
|
|
160
|
+
|
|
161
|
+
// Process callbacks or restore the existing session as in the quick start,
|
|
162
|
+
// and let the user sign in before acquiring resource tokens.
|
|
163
|
+
async function loadApis(): Promise<void> {
|
|
164
|
+
const ordersFetch = oidcClient.fetchForResource(ordersResource, fetch);
|
|
165
|
+
const inventoryFetch = oidcClient.fetchForResource(inventoryResource, fetch);
|
|
166
|
+
const [orders, inventory] = await Promise.all([
|
|
167
|
+
ordersFetch('https://orders.example.com/v1/orders'),
|
|
168
|
+
inventoryFetch('https://inventory.example.com/v1/items'),
|
|
169
|
+
]);
|
|
170
|
+
if (!orders.ok || !inventory.ok) throw new Error('A protected API request failed.');
|
|
171
|
+
const data = await Promise.all([orders.json(), inventory.json()]);
|
|
172
|
+
console.log(data); // API data, not tokens.
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Equivalent selection through the existing fetch pipeline:
|
|
176
|
+
const selectedFetch = oidcClient.fetchWithTokens(fetch, false, { resource: ordersResource });
|
|
177
|
+
|
|
178
|
+
const token = await oidcClient.getAccessTokenForResourceAsync(ordersResource);
|
|
179
|
+
await oidcClient.getAccessTokenForResourceAsync(ordersResource, { forceRenew: true });
|
|
180
|
+
const cached = oidcClient.getAccessTokenForResource(ordersResource); // token or null; no authorization
|
|
181
|
+
await oidcClient.clearResourceTokensAsync(ordersResource);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
`ResourceAccessToken` contains `resource`, `issuer`, `clientId`,
|
|
185
|
+
`configurationName`, `accessToken`, Unix-seconds `expiresAt`, and optional
|
|
186
|
+
`scope`/`tokenType`. It does not expose refresh tokens or DPoP private keys.
|
|
187
|
+
In worker mode `accessToken` is a secured placeholder, even when default-token
|
|
188
|
+
`showAccessToken` is enabled. Do not log token values or use placeholders outside
|
|
189
|
+
the configured worker.
|
|
190
|
+
|
|
191
|
+
### Acquisition, renewal, and clearing
|
|
192
|
+
|
|
193
|
+
- Each existing OIDC client owns one reusable resource manager. Separate entries
|
|
194
|
+
retain default and sibling access tokens; no additional OIDC client is created.
|
|
195
|
+
Default renewal updates only the default entry, even for single-resource grants.
|
|
196
|
+
Restoring a persisted resource entry emits `resource_token_acquired` when its
|
|
197
|
+
public snapshot changes; unchanged cache hits do not emit another event.
|
|
198
|
+
- Resources and requested scopes already included in the initial grant may use
|
|
199
|
+
its refresh token. Rotation is serialized with default-token renewal using
|
|
200
|
+
Web Locks, or a local queue when Web Locks are unavailable.
|
|
201
|
+
- A new resource, additional scope, unavailable refresh token, or `invalid_grant`
|
|
202
|
+
triggers bounded silent authorization with `prompt=none`. Serve both silent
|
|
203
|
+
routes using the existing callback integration (React's provider supplies
|
|
204
|
+
this routing). Cookies, provider consent, and provider capabilities still apply.
|
|
205
|
+
Additional authorization requires a fresh ID token for the same authenticated
|
|
206
|
+
subject. Resource refresh may omit an ID token; an earlier ID token's expiration
|
|
207
|
+
does not prevent renewal of the resource access token.
|
|
208
|
+
- Separately authorized resources retain independent grants. Providers reusing
|
|
209
|
+
the identical refresh token across separate authorization transactions are
|
|
210
|
+
rejected; use an initial multi-resource grant with such providers.
|
|
211
|
+
- Resource tokens follow `token_automatic_renew_mode`; the fetch-only mode renews
|
|
212
|
+
on acquisition/fetch. Concurrent acquisition of the same resource is deduplicated.
|
|
213
|
+
The renewal margin is capped at half the issued access-token lifetime to avoid
|
|
214
|
+
immediate renewal loops for short-lived API tokens.
|
|
215
|
+
- Clearing a resource is local-only: it drops that entry and its transaction
|
|
216
|
+
state, but does not revoke the shared grant or clear siblings. Clearing
|
|
217
|
+
invalidates in-flight cache lookups as well as network responses. Session
|
|
218
|
+
clearing removes all resource entries. Logout follows
|
|
219
|
+
`logout_tokens_to_invalidate`, including resource access tokens and independent
|
|
220
|
+
refresh grants, deduplicating shared refresh tokens.
|
|
221
|
+
- Resource entries follow the client's existing storage/tab configuration.
|
|
222
|
+
Resource responses cannot change the authenticated subject or recreate a
|
|
223
|
+
cleared entry. A new default authorization invalidates prior resource entries.
|
|
224
|
+
|
|
225
|
+
### Destination and provider limitations
|
|
226
|
+
|
|
227
|
+
- API prefixes match parsed HTTP(S) origins and pathname boundaries, not
|
|
228
|
+
hostname suffixes or regular expressions. Resource URIs may also be URNs.
|
|
229
|
+
Fragments, credentials, and encoded path separators are rejected for API URLs;
|
|
230
|
+
prefixes must not contain queries.
|
|
231
|
+
- Resource fetch always rejects automatic redirects; `redirect: 'follow'` in
|
|
232
|
+
fetch options is rejected before acquisition. With `redirect: 'manual'`, handle the response
|
|
233
|
+
yourself and issue a separately validated request if appropriate.
|
|
234
|
+
- API origins registered in `resources` require explicit selection in authenticated
|
|
235
|
+
fetch, including paths outside their permitted prefixes (which require a new
|
|
236
|
+
mapping before resource fetch will permit them). Plain fetch can still make anonymous requests. Outside managed origins,
|
|
237
|
+
legacy fetch behavior is unchanged.
|
|
238
|
+
- Worker selection must satisfy both resource mappings and
|
|
239
|
+
`OidcTrustedDomains.js`. Deploy the matching worker: missing/older workers
|
|
240
|
+
reject resource acquisition with `RESOURCE_WORKER_UNSUPPORTED` instead of
|
|
241
|
+
falling back to browser storage. Lost worker memory requires restoring or
|
|
242
|
+
reauthenticating the original session; stale placeholders cannot recover grants.
|
|
243
|
+
- DPoP tokens retain their grant's key and nonce, and API proofs hash the selected
|
|
244
|
+
resource access token. Follow the existing DPoP setup, including worker settings.
|
|
245
|
+
Proof targets omit URL queries and fragments as required by RFC 9449.
|
|
246
|
+
API `DPoP-Nonce` responses are retained separately for each resource, not mixed
|
|
247
|
+
with token-endpoint nonces. API HTTP responses are returned without automatic
|
|
248
|
+
retries; callers decide whether to retry a nonce challenge.
|
|
249
|
+
- Configure `audiences` for JWT access tokens; resource identifiers need not equal
|
|
250
|
+
JWT audiences. Configured audience and issuer mismatches are rejected.
|
|
251
|
+
Without an audience mapping, and for opaque tokens, the client must trust the
|
|
252
|
+
provider to honor `resource`. No token introspection, signature-verification
|
|
253
|
+
extension, or token exchange is introduced. APIs must validate tokens themselves.
|
|
254
|
+
- Explicit insufficient returned scopes are rejected. As specified by OAuth,
|
|
255
|
+
omitted `scope` is treated as the requested scope; this also requires a
|
|
256
|
+
conforming provider.
|
|
257
|
+
- `invalid_target`, login/consent requirements, network failures, and silent
|
|
258
|
+
timeouts remain explicit. The client never retries by stripping `resource`,
|
|
259
|
+
using a default/sibling token, or navigating interactively. Catch acquisition
|
|
260
|
+
errors and offer a user-driven sign-in/consent action appropriate to the provider.
|
|
261
|
+
|
|
262
|
+
Observe `resource_token_acquired`, `resource_token_cleared`, and
|
|
263
|
+
`resource_token_error` through `subscribeEvents`; each identifies its resource,
|
|
264
|
+
and errors include the typed `OidcError`. See the [FAQ](../../FAQ.md#how-do-i-call-multiple-apis-with-different-audiences)
|
|
265
|
+
for troubleshooting.
|
|
266
|
+
|
|
107
267
|
<a id="service-worker-support"></a>
|
|
108
268
|
|
|
109
269
|
## Service worker
|
|
@@ -226,6 +386,16 @@ Silent login uses an iframe and the provider's existing session. It depends on p
|
|
|
226
386
|
|
|
227
387
|
For a vanilla application, implement both the `silent_login_uri` page and the `silent_redirect_uri` callback page. The login page starts `loginAsync` with `isSilentSignin: true` (the third argument); the callback page calls `silentLoginCallbackAsync()`. Keep these routes separate from the interactive callback. The React provider handles these routes for you; its [silent-login route implementation](../react-oidc/src/core/default-component/SilentLogin.component.tsx) is also a reference for forwarding silent-login parameters.
|
|
228
388
|
|
|
389
|
+
To request iframe-only sign-in from the main page, call
|
|
390
|
+
`loginAsync(undefined, undefined, false, undefined, true)`. This existing entry
|
|
391
|
+
point preserves its fulfilled-result convention: provider and timeout failures
|
|
392
|
+
resolve with an `Error` value, and disabled silent callbacks resolve `undefined`.
|
|
393
|
+
Check `result instanceof Error` after awaiting it; errors are also reported by
|
|
394
|
+
silent-login events. Resource-acquisition methods reject on failure. A failed
|
|
395
|
+
attempt does not replace the current main-session tokens or cancel their renewal
|
|
396
|
+
timer. Supply both silent routes, and retain all API scopes required by configured
|
|
397
|
+
resources if overriding the scope.
|
|
398
|
+
|
|
229
399
|
## Token renewal
|
|
230
400
|
|
|
231
401
|
By default, the client schedules renewal before tokens expire. It uses a refresh token when available, or the configured silent-login flow. Refresh-token issuance and lifetime remain provider decisions.
|
|
@@ -266,6 +436,10 @@ The PAR endpoint must allow CORS from your application and accept public clients
|
|
|
266
436
|
|
|
267
437
|
## DPoP
|
|
268
438
|
|
|
439
|
+
Generated `htu` values exclude query strings and fragments, as RFC 9449 requires;
|
|
440
|
+
relative targets resolve against the current browser location. Worker registration
|
|
441
|
+
also preserves existing URL query parameters when appending the SDK version.
|
|
442
|
+
|
|
269
443
|
[Demonstrating Proof of Possession (RFC 9449)](https://www.rfc-editor.org/rfc/rfc9449.html) binds supported tokens to a key and uses signed proofs for requests. It requires support from the authorization server and resource server. It reduces the usefulness of a stolen token without its key; it does not make an application immune to XSS.
|
|
270
444
|
|
|
271
445
|
For client-side DPoP, set `demonstrating_proof_of_possession: true` in the OIDC configuration and opt in for protected requests:
|
|
@@ -345,6 +519,58 @@ const subscriptionId = oidcClient.subscribeEvents((name, data) => {
|
|
|
345
519
|
oidcClient.removeEventSubscription(subscriptionId);
|
|
346
520
|
```
|
|
347
521
|
|
|
522
|
+
### Token synchronization events
|
|
523
|
+
|
|
524
|
+
Use `OidcClient.eventNames` with `subscribeEvents` to observe synchronization, including checks that reuse valid tokens without a refresh request. Automatic renewal checks can emit these events approximately once per second; browser scheduling and the time spent synchronizing can delay them.
|
|
525
|
+
|
|
526
|
+
| Event | Payload | Meaning |
|
|
527
|
+
| ----------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
528
|
+
| `syncTokensAsync_begin` | `{}` | Synchronization is starting. |
|
|
529
|
+
| `syncTokensAsync_end` | `{ status }` | Synchronization resolved; inspect `status` to determine the outcome. |
|
|
530
|
+
| `syncTokensAsync_error` | `{ message, error, exception }` | Synchronization threw. `message` is `'sync tokens error'`; `exception` is the original thrown value, and `error` is that same value only when it is an `OidcError`, otherwise `undefined`. |
|
|
531
|
+
|
|
532
|
+
One synchronization run emits a begin event followed by an end or error event. Internal refresh retries do not emit additional lifecycle pairs. When a cross-tab lock is needed but unavailable, `syncTokensAsync_lock_not_available` is emitted before synchronization begins and can repeat while waiting for the lock. The lifecycle events are emitted both with and without a lock.
|
|
533
|
+
|
|
534
|
+
An end event reports resolution, including the following outcomes:
|
|
535
|
+
|
|
536
|
+
| `status` | Meaning |
|
|
537
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
538
|
+
| `'LOGGED_IN'` | Tokens are valid, were refreshed, or were synchronized from another tab. |
|
|
539
|
+
| `'LOGGED'` | Silent login supplied tokens. |
|
|
540
|
+
| `'SESSION_LOST'` | Synchronization could not retain the session. Existing `refreshTokensAsync_error` events carry the renewal error. |
|
|
541
|
+
| `'LOGGED_OUT'` | Synchronization detected logout or missing stored tokens. |
|
|
542
|
+
| `'GIVE_UP'` | Renewal was deferred, for example while offline in a hidden document or when waiting for an API request to trigger renewal. This does not establish token validity. |
|
|
543
|
+
| `null` | There were no current tokens to synchronize. |
|
|
544
|
+
|
|
545
|
+
Resolved failures such as `'SESSION_LOST'` emit an end event rather than a synchronization error event. After an error event, the original synchronization exception is rethrown; no end event follows it.
|
|
546
|
+
|
|
547
|
+
These events cover synchronization itself. Initial worker setup and lock acquisition happen before the begin event; subsequent storage updates, session destruction, and timer scheduling happen after the end event. Failures in those steps are outside this event boundary, so an end event does not guarantee that the renewal call has finished successfully.
|
|
548
|
+
|
|
549
|
+
Keep subscribers lightweight and do not throw: subscriber exceptions propagate and can interrupt renewal. Log only selected diagnostic fields. The error payload contains the original exception, whose properties or cause may include sensitive data; do not log complete payloads, exceptions, or tokens.
|
|
550
|
+
|
|
551
|
+
```typescript
|
|
552
|
+
import { isOidcError, OidcClient } from '@axa-fr/oidc-client';
|
|
553
|
+
|
|
554
|
+
// Use an already initialized client.
|
|
555
|
+
const oidcClient = OidcClient.getOrThrow();
|
|
556
|
+
const subscriptionId = oidcClient.subscribeEvents((name, data) => {
|
|
557
|
+
if (name === OidcClient.eventNames.syncTokensAsync_end) {
|
|
558
|
+
console.debug(name, data.status);
|
|
559
|
+
} else if (name === OidcClient.eventNames.syncTokensAsync_error) {
|
|
560
|
+
if (isOidcError(data.error)) {
|
|
561
|
+
console.warn(name, data.error.code, data.error.phase, data.error.status);
|
|
562
|
+
} else {
|
|
563
|
+
console.warn(name);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
// When the subscriber is no longer needed:
|
|
569
|
+
oidcClient.removeEventSubscription(subscriptionId);
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
React applications can observe the same payloads with the provider's `onEvent(configurationName, eventName, data)` callback. See [React error handling](../react-oidc/README.md#errors-and-missing-providers) for its session-loss response.
|
|
573
|
+
|
|
348
574
|
### Missing or mismatched login state
|
|
349
575
|
|
|
350
576
|
`OidcStateError` extends `OidcError` and identifies callback-state failures:
|
package/dist/events.d.ts
CHANGED
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCtB,CAAC"}
|
package/dist/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as Oidc } from './oidc';
|
|
2
2
|
import { OidcErrorPhase } from './oidcError';
|
|
3
|
-
import { Fetch } from './types';
|
|
4
|
-
export declare const fetchWithTokens: (fetch: Fetch, oidc: Oidc, demonstrating_proof_of_possession?: boolean,
|
|
3
|
+
import { Fetch, ResourceFetchOptions } from './types';
|
|
4
|
+
export declare const fetchWithTokens: (fetch: Fetch, oidc: Oidc, demonstrating_proof_of_possession?: boolean, selection?: OidcErrorPhase | ResourceFetchOptions) => Fetch;
|
|
5
5
|
//# sourceMappingURL=fetch.d.ts.map
|
package/dist/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAgD,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,EAAgD,cAAc,EAAE,MAAM,aAAa,CAAC;AAQ3F,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGtD,eAAO,MAAM,eAAe,GAExB,OAAO,KAAK,EACZ,MAAM,IAAI,EACV,oCAAmC,OAAe,EAClD,YAAW,cAAc,GAAG,oBAAoC,KAC/D,KAsLF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export type { ServiceWorkerMessage, ServiceWorkerMessageTypeKey, ServiceWorkerMe
|
|
|
14
14
|
export { buildDpopSecuredPlaceholder, buildSecuredTokenPlaceholder, buildStorageKey, DPOP_TOKEN_PLACEHOLDER_PREFIX, isServiceWorkerMessageType, PROTOCOL_VERSION, ServiceWorkerMessageType, STORAGE_KEY_PREFIX, SW_CONTROLLER_CHANGE_RELOAD_COUNT_KEY, TOKEN_PLACEHOLDERS, } from './protocol.js';
|
|
15
15
|
export { isPushedAuthorizationRequestError, PushedAuthorizationRequestError, PushedAuthorizationRequestErrorCode, } from './pushedAuthorizationRequestError.js';
|
|
16
16
|
export { getParseQueryStringFromLocation, getPath } from './route-utils';
|
|
17
|
-
export type { AuthorityConfiguration, Fetch, OidcConfiguration, PushedAuthorizationRequestMode, StringMap, } from './types.js';
|
|
17
|
+
export type { AuthorityConfiguration, Fetch, OidcConfiguration, OidcResourceConfiguration, PushedAuthorizationRequestMode, ResourceAccessToken, ResourceFetchOptions, ResourceTokenOptions, StringMap, } from './types.js';
|
|
18
18
|
export { TokenAutomaticRenewMode } from './types.js';
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACvE,OA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