@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 +19 -15
- package/dist/README.md +19 -15
- package/dist/package.json +1 -1
- package/dist/src/connect.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
# @edirect/oidc-client
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
```
|
|
8
|
-
|
|
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: '
|
|
18
|
-
baseUrl:
|
|
19
|
-
oidcPath:
|
|
20
|
-
clientId:
|
|
21
|
-
clientSecret:
|
|
22
|
-
redirectUri:
|
|
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:
|
|
27
|
-
password:
|
|
28
|
-
};
|
|
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
|
-
|
|
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
|
-
```
|
|
8
|
-
|
|
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: '
|
|
18
|
-
baseUrl:
|
|
19
|
-
oidcPath:
|
|
20
|
-
clientId:
|
|
21
|
-
clientSecret:
|
|
22
|
-
redirectUri:
|
|
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:
|
|
27
|
-
password:
|
|
28
|
-
};
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":"
|
|
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"}
|