@muze-nl/metro-oidc 0.3.3 → 0.3.5

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 CHANGED
@@ -5,10 +5,10 @@
5
5
  The OpenID Connect middleware allows you to configure a [metro client](https://github.com/muze-nl/metro) to handle authorization and authentication using OpenID Connect:
6
6
 
7
7
  ```javascript
8
- import oidcmw from '@muze-nl/metro-oidc'
8
+ import oidc from '@muze-nl/metro-oidc'
9
9
 
10
10
  const client = metro.client('https://oauth2api.example.com')
11
- .with( oidcmw({
11
+ .with( oidc.oidcmw({
12
12
  client_info: {
13
13
  client_name: 'My Client',
14
14
  redirect_uris: [
@@ -23,6 +23,8 @@ async function fetchMovies() {
23
23
  }
24
24
  ````
25
25
 
26
+ _Note_: If your client has more than 1 possible `redirect_uri`, all will be used to register that client, but the first one will be used for this session. So make sure to put the `redirect_uri` you want to use now at `redirect_uris[0]``.
27
+
26
28
  The OIDC middleware will automatically discover the configuration of the issuer, as well as do a dynamic client registration, if you haven't set a `client_info.client_id`.
27
29
  It will then configure the correct OAuth2 settings and handle the request with [metro oauth2](https://github.com/muze-nl/metro-oauth2) middleware. It may redirect the browser to let the user login with the OIDC issuer. You can skip the automatic configuration step, if you provide the `openid_configuration` parameter set yourself. If you don't, the oidcmw middleware will only run the discovery process once, and store the information in localStorage. The same with the client_info and dynamic registration.
28
30
 
@@ -30,7 +32,7 @@ It will then configure the correct OAuth2 settings and handle the request with [
30
32
 
31
33
  metro.oidc uses OAuth2.1 by default, including PKCE and DPoP. The Keypair used in DPoP is created non-extractable, so they cannot be leaked. This means that the access_token and refresh_token, even if leaked, cannot be used anywhere else.
32
34
 
33
- You can disable PCKE by setting `options.client_info.code_verifier` to false.
35
+ You can disable PKCE by setting `options.client_info.code_verifier` to false.
34
36
  You can disable DPoP by setting `options.use_dpop` to false.
35
37
 
36
38
  ## id_token