1
1
# Table of contents
2
+
2
3
- [ Concepts] ( #concepts )
3
4
- [ Extensibility] ( #extensibility )
4
- * [ Logging] ( #logging )
5
- * [ Request correlations] ( #request-correlations )
6
- + [ Example with the internal HTTP client:] ( #example-with-the-internal-http-client )
7
- + [ Example with Superagent:] ( #example-with-superagent )
8
- * [ Claims provider] ( #claims-provider )
5
+ - [ Logging] ( #logging )
6
+ - [ Request correlations] ( #request-correlations )
7
+ - [ Example with the internal HTTP client:] ( #example-with-the-internal-http-client )
8
+ - [ Example with Superagent:] ( #example-with-superagent )
9
+ - [ Claims provider] ( #claims-provider )
9
10
- [ Configuration] ( #configuration )
10
- * [ IOidcClientConfig] ( #ioidcclientconfig )
11
- * [ IOidcSessionConfig] ( #ioidcsessionconfig )
12
- * [ IOidcAuthenticatorConfig] ( #ioidcauthenticatorconfig )
13
- * [ IHttpDefaults] ( #ihttpdefaults )
14
- * [ IOidcFactory] ( #ioidcfactory )
11
+ - [ IOidcClientConfig] ( #ioidcclientconfig )
12
+ - [ IOidcSessionConfig] ( #ioidcsessionconfig )
13
+ - [ IOidcAuthenticatorConfig] ( #ioidcauthenticatorconfig )
14
+ - [ IHttpDefaults] ( #ihttpdefaults )
15
+ - [ IOidcFactory] ( #ioidcfactory )
15
16
- [ Flows] ( #flows )
16
- * [ Request or renew a token] ( #request-or-renew-a-token )
17
- * [ Use an existing token] ( #use-an-existing-token )
18
- * [ Retry a failed request] ( #retry-a-failed-request )
17
+ - [ Request or renew a token] ( #request-or-renew-a-token )
18
+ - [ Use an existing token] ( #use-an-existing-token )
19
+ - [ Retry a failed request] ( #retry-a-failed-request )
19
20
- [ Object model] ( #object-model )
20
- * [ High level relationships] ( #high-level-relationships )
21
- * [ Session states] ( #session-states )
22
- * [ Http client] ( #http-client )
21
+ - [ High level relationships] ( #high-level-relationships )
22
+ - [ Session states] ( #session-states )
23
+ - [ Http client] ( #http-client )
23
24
- [ Introspection] ( #introspection )
24
25
- [ Unit testing] ( #unit-testing )
25
26
@@ -61,7 +62,7 @@ import * as superagent from 'superagent';
61
62
import {
62
63
authenticator ,
63
64
createSession ,
64
- } from ' @villemontreal /auth-oidc-plugin-superagent' ;
65
+ } from ' @villedemontreal /auth-oidc-plugin-superagent' ;
65
66
// configure
66
67
const session = createSession ({
67
68
authMethod: ' client_secret_basic' ,
@@ -96,7 +97,7 @@ import * as superagent from 'superagent';
96
97
import {
97
98
authenticator ,
98
99
createSession ,
99
- } from ' @villemontreal /auth-oidc-plugin-superagent' ;
100
+ } from ' @villedemontreal /auth-oidc-plugin-superagent' ;
100
101
// configure
101
102
const session = createSession ({
102
103
authMethod: ' client_secret_basic' ,
@@ -120,7 +121,7 @@ will provide the same advantage of handling the token management and expose a si
120
121
Example:
121
122
122
123
``` typescript
123
- import { createSession , OidcHttpClient } from ' @villemontreal /auth-oidc' ;
124
+ import { createSession , OidcHttpClient } from ' @villedemontreal /auth-oidc' ;
124
125
// configure
125
126
const session = createSession ({
126
127
authMethod: ' client_secret_basic' ,
@@ -159,7 +160,7 @@ So, you can provide your own logger, your own token store, your own token provid
159
160
Example:
160
161
161
162
``` typescript
162
- import { ConsoleLogger } from ' @villemontreal /auth-core' ;
163
+ import { ConsoleLogger } from ' @villedemontreal /auth-core' ;
163
164
const sessionConfig: IOidcSessionConfig = {
164
165
factory: {
165
166
createTokenStore : (logger ) => new MyCustomTokenStore (logger ),
@@ -178,7 +179,7 @@ return an instance of the [ConsoleLogger](../packages/core/src/logging/ConsoleLo
178
179
Example:
179
180
180
181
``` typescript
181
- import { ConsoleLogger } from ' @villemontreal /auth-core' ;
182
+ import { ConsoleLogger } from ' @villedemontreal /auth-core' ;
182
183
const sessionConfig: IOidcSessionConfig = {
183
184
factory: {
184
185
createLogger : () => new ConsoleLogger (),
@@ -192,7 +193,7 @@ Of course, you should use your own logging library instead for a consistant logg
192
193
Also, the default HTTP client will log the execution of the requests by default (including the elapsed time), but you can disable this behaviour using the IHttpDefaults:
193
194
194
195
``` typescript
195
- import { ConsoleLogger } from ' @villemontreal /auth-core' ;
196
+ import { ConsoleLogger } from ' @villedemontreal /auth-core' ;
196
197
const sessionConfig: IOidcSessionConfig = {
197
198
factory: {
198
199
createLogger : () => new ConsoleLogger (),
@@ -237,7 +238,10 @@ The examples are already setup to use the default correlator.
237
238
### Example with the internal HTTP client:
238
239
239
240
``` typescript
240
- import { ConsoleLogger , HttpRequestCorrelator } from ' @villemontreal/auth-core' ;
241
+ import {
242
+ ConsoleLogger ,
243
+ HttpRequestCorrelator ,
244
+ } from ' @villedemontreal/auth-core' ;
241
245
const correlator = new HttpRequestCorrelator ();
242
246
const sessionConfig: IOidcSessionConfig = {
243
247
factory: {
@@ -263,7 +267,10 @@ Note that in this case you must share the correlator with the IHttpDefaults and
263
267
requestCorrelator plugin.
264
268
265
269
``` typescript
266
- import { ConsoleLogger , HttpRequestCorrelator } from ' @villemontreal/auth-core' ;
270
+ import {
271
+ ConsoleLogger ,
272
+ HttpRequestCorrelator ,
273
+ } from ' @villedemontreal/auth-core' ;
267
274
const correlator = new HttpRequestCorrelator ();
268
275
const sessionConfig: IOidcSessionConfig = {
269
276
factory: {
@@ -451,7 +458,7 @@ If you need to validate an existing access token, find information about the OID
451
458
To build such an inspector, import the createInspector function and provide a valid OIDC session:
452
459
453
460
``` typescript
454
- import { createInspector , createSession } from ' @villemontreal /auth-oidc' ;
461
+ import { createInspector , createSession } from ' @villedemontreal /auth-oidc' ;
455
462
const session = createSession (clientConfig , sessionConfig );
456
463
const inspector = createInspector (session , {
457
464
introspectionEndpointAuthMethod: ' client_secret_basic' ,
@@ -472,12 +479,12 @@ if your code needs to access the claims of the current access token.
472
479
Example:
473
480
474
481
``` typescript
475
- import { FakeLogger , FakeTimeProvider } from ' @villemontreal /auth-core' ;
482
+ import { FakeLogger , FakeTimeProvider } from ' @villedemontreal /auth-core' ;
476
483
import {
477
484
FakeClaimsprovider ,
478
485
FakeTokenProvider ,
479
486
IOidcSessionConfig ,
480
- } from ' @villemontreal /auth-oidc' ;
487
+ } from ' @villedemontreal /auth-oidc' ;
481
488
// setup
482
489
const logger = new FakeLogger ();
483
490
const timeProvider = new FakeTimeProvider (new Date (2019 , 12 , 26 , 17 , 23 , 44 ));
0 commit comments