@edirect/oidc-client 11.0.40 → 11.0.42

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
@@ -1,11 +1,17 @@
1
1
  # @edirect/oidc-client
2
2
 
3
- The EDirectInsure OpenId Connect Client.
3
+ OpenID Connect client for Edirect applications. Provides a simple interface for authenticating with OIDC providers, supporting multiple grant types and token management.
4
+
5
+ ## Features
6
+
7
+ - Supports password, client_credentials, and other grant types
8
+ - Handles access and refresh tokens
9
+ - Integrates with Edirect config modules
4
10
 
5
11
  ## Installation
6
12
 
7
- ```shell
8
- $ npm i --save @edirect/oidc-client
13
+ ```bash
14
+ npm install @edirect/oidc-client
9
15
  ```
10
16
 
11
17
  ## Usage
@@ -14,22 +20,20 @@ $ npm i --save @edirect/oidc-client
14
20
  (async () => {
15
21
  const OidcClient = require('@edirect/oidc-client');
16
22
  const oidcClient = await OidcClient({
17
- grantType: 'GRANT_TYPE',
18
- baseUrl: 'OIDC_PROVIDER_URL',
19
- oidcPath: 'OIDC_PROVIDER_PATH',
20
- clientId: 'YOUR_CLIENT_ID',
21
- clientSecret: 'YOUR_CLIENT_SECRET',
22
- redirectUri: 'YOUR_CALLBACK_URL',
23
+ grantType: 'password' | 'client_credentials' | 'authorization_code',
24
+ baseUrl: process.env.OIDC_PROVIDER_URL,
25
+ oidcPath: process.env.OIDC_PROVIDER_PATH,
26
+ clientId: process.env.OIDC_CLIENT_ID,
27
+ clientSecret: process.env.OIDC_CLIENT_SECRET,
28
+ redirectUri: process.env.OIDC_CALLBACK_URL,
23
29
  });
24
30
 
25
31
  const loginData = {
26
- username: 'USERNAME',
27
- password: 'PASSWORD',
28
- }; // only necessary to password grant type
32
+ username: process.env.OIDC_USERNAME,
33
+ password: process.env.OIDC_PASSWORD,
34
+ };
29
35
 
30
- const accessTokenSet = await oidcClient.getAccessToken(
31
- loginData || undefined
32
- );
36
+ const accessTokenSet = await oidcClient.getAccessToken(loginData);
33
37
  console.log('\n', { accessTokenSet }, '\n');
34
38
 
35
39
  // not applicable to client_credentials grant type
package/dist/README.md CHANGED
@@ -1,11 +1,17 @@
1
1
  # @edirect/oidc-client
2
2
 
3
- The EDirectInsure OpenId Connect Client.
3
+ OpenID Connect client for Edirect applications. Provides a simple interface for authenticating with OIDC providers, supporting multiple grant types and token management.
4
+
5
+ ## Features
6
+
7
+ - Supports password, client_credentials, and other grant types
8
+ - Handles access and refresh tokens
9
+ - Integrates with Edirect config modules
4
10
 
5
11
  ## Installation
6
12
 
7
- ```shell
8
- $ npm i --save @edirect/oidc-client
13
+ ```bash
14
+ npm install @edirect/oidc-client
9
15
  ```
10
16
 
11
17
  ## Usage
@@ -14,22 +20,20 @@ $ npm i --save @edirect/oidc-client
14
20
  (async () => {
15
21
  const OidcClient = require('@edirect/oidc-client');
16
22
  const oidcClient = await OidcClient({
17
- grantType: 'GRANT_TYPE',
18
- baseUrl: 'OIDC_PROVIDER_URL',
19
- oidcPath: 'OIDC_PROVIDER_PATH',
20
- clientId: 'YOUR_CLIENT_ID',
21
- clientSecret: 'YOUR_CLIENT_SECRET',
22
- redirectUri: 'YOUR_CALLBACK_URL',
23
+ grantType: 'password' | 'client_credentials' | 'authorization_code',
24
+ baseUrl: process.env.OIDC_PROVIDER_URL,
25
+ oidcPath: process.env.OIDC_PROVIDER_PATH,
26
+ clientId: process.env.OIDC_CLIENT_ID,
27
+ clientSecret: process.env.OIDC_CLIENT_SECRET,
28
+ redirectUri: process.env.OIDC_CALLBACK_URL,
23
29
  });
24
30
 
25
31
  const loginData = {
26
- username: 'USERNAME',
27
- password: 'PASSWORD',
28
- }; // only necessary to password grant type
32
+ username: process.env.OIDC_USERNAME,
33
+ password: process.env.OIDC_PASSWORD,
34
+ };
29
35
 
30
- const accessTokenSet = await oidcClient.getAccessToken(
31
- loginData || undefined
32
- );
36
+ const accessTokenSet = await oidcClient.getAccessToken(loginData);
33
37
  console.log('\n', { accessTokenSet }, '\n');
34
38
 
35
39
  // not applicable to client_credentials grant type
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edirect/oidc-client",
3
- "version": "11.0.40",
3
+ "version": "11.0.41",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,qBAAa,WAAW;IACtB,aAAa,EAAE,GAAG,CAAC;IACnB,OAAO,EAAG,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,gBAAgB,CAAC;;IAMzB,OAAO,CAAC,MAAM,EAAE,OAAO;CAsB9B"}
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,qBAAa,WAAW;IACtB,aAAa,EAAE,GAAG,CAAC;IACnB,OAAO,EAAG,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,gBAAgB,CAAC;;IAMzB,OAAO,CAAC,MAAM,EAAE,OAAO;CAsB9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edirect/oidc-client",
3
- "version": "11.0.40",
3
+ "version": "11.0.42",
4
4
  "packageScope": "@edirect",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",