@edirect/oidc-client 11.0.48 → 11.0.49
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 +24 -24
- package/dist/README.md +24 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,8 +28,8 @@ import OidcClient from '@edirect/oidc-client';
|
|
|
28
28
|
|
|
29
29
|
const client = await OidcClient({
|
|
30
30
|
grantType: 'password',
|
|
31
|
-
baseUrl: process.env.OIDC_PROVIDER_URL,
|
|
32
|
-
oidcPath: process.env.OIDC_PROVIDER_PATH,
|
|
31
|
+
baseUrl: process.env.OIDC_PROVIDER_URL, // e.g., 'https://keycloak.example.com'
|
|
32
|
+
oidcPath: process.env.OIDC_PROVIDER_PATH, // e.g., '/realms/my-realm'
|
|
33
33
|
clientId: process.env.OIDC_CLIENT_ID,
|
|
34
34
|
clientSecret: process.env.OIDC_CLIENT_SECRET,
|
|
35
35
|
});
|
|
@@ -92,21 +92,21 @@ const tokenSet = await client.getAccessToken({ code: authorizationCode });
|
|
|
92
92
|
|
|
93
93
|
Factory function that initializes the OIDC client for the specified grant type.
|
|
94
94
|
|
|
95
|
-
| Parameter
|
|
96
|
-
|
|
97
|
-
| `grantType`
|
|
98
|
-
| `baseUrl`
|
|
99
|
-
| `oidcPath`
|
|
100
|
-
| `clientId`
|
|
101
|
-
| `clientSecret` | `string`
|
|
102
|
-
| `redirectUri`
|
|
95
|
+
| Parameter | Type | Description |
|
|
96
|
+
| -------------- | --------------------------------------------- | ------------------------------------------ |
|
|
97
|
+
| `grantType` | `'password' \| 'client_credentials' \| 'sso'` | OAuth2 grant type |
|
|
98
|
+
| `baseUrl` | `string` | OIDC provider base URL |
|
|
99
|
+
| `oidcPath` | `string` | OIDC realm path (e.g., `/realms/my-realm`) |
|
|
100
|
+
| `clientId` | `string` | Client ID registered in the OIDC provider |
|
|
101
|
+
| `clientSecret` | `string` | Client secret |
|
|
102
|
+
| `redirectUri` | `string` | Callback URL (for `sso` grant) |
|
|
103
103
|
|
|
104
104
|
### Client Methods
|
|
105
105
|
|
|
106
|
-
| Method
|
|
107
|
-
|
|
108
|
-
| `getAccessToken`
|
|
109
|
-
| `getRefreshToken` | `(tokenSet) => Promise<TokenSet>`
|
|
106
|
+
| Method | Signature | Description |
|
|
107
|
+
| ----------------- | ----------------------------------- | ------------------------------------------------------------ |
|
|
108
|
+
| `getAccessToken` | `(loginData?) => Promise<TokenSet>` | Acquire an access token |
|
|
109
|
+
| `getRefreshToken` | `(tokenSet) => Promise<TokenSet>` | Refresh an existing token set (not for `client_credentials`) |
|
|
110
110
|
|
|
111
111
|
### `TokenSet`
|
|
112
112
|
|
|
@@ -115,7 +115,7 @@ interface TokenSet {
|
|
|
115
115
|
access_token: string;
|
|
116
116
|
token_type: string;
|
|
117
117
|
expires_in: number;
|
|
118
|
-
refresh_token?: string;
|
|
118
|
+
refresh_token?: string; // not present for client_credentials
|
|
119
119
|
refresh_expires_in?: number;
|
|
120
120
|
id_token?: string;
|
|
121
121
|
session_state?: string;
|
|
@@ -125,12 +125,12 @@ interface TokenSet {
|
|
|
125
125
|
|
|
126
126
|
## Environment Variables
|
|
127
127
|
|
|
128
|
-
| Variable
|
|
129
|
-
|
|
130
|
-
| `OIDC_PROVIDER_URL`
|
|
131
|
-
| `OIDC_PROVIDER_PATH` | OIDC realm path (e.g., `/realms/my-realm`)
|
|
132
|
-
| `OIDC_CLIENT_ID`
|
|
133
|
-
| `OIDC_CLIENT_SECRET` | Client secret
|
|
134
|
-
| `OIDC_USERNAME`
|
|
135
|
-
| `OIDC_PASSWORD`
|
|
136
|
-
| `OIDC_CALLBACK_URL`
|
|
128
|
+
| Variable | Description |
|
|
129
|
+
| -------------------- | ------------------------------------------------------------- |
|
|
130
|
+
| `OIDC_PROVIDER_URL` | OIDC provider base URL (e.g., `https://keycloak.example.com`) |
|
|
131
|
+
| `OIDC_PROVIDER_PATH` | OIDC realm path (e.g., `/realms/my-realm`) |
|
|
132
|
+
| `OIDC_CLIENT_ID` | Client ID |
|
|
133
|
+
| `OIDC_CLIENT_SECRET` | Client secret |
|
|
134
|
+
| `OIDC_USERNAME` | Username (for `password` grant) |
|
|
135
|
+
| `OIDC_PASSWORD` | Password (for `password` grant) |
|
|
136
|
+
| `OIDC_CALLBACK_URL` | Redirect URI (for `sso` grant) |
|
package/dist/README.md
CHANGED
|
@@ -28,8 +28,8 @@ import OidcClient from '@edirect/oidc-client';
|
|
|
28
28
|
|
|
29
29
|
const client = await OidcClient({
|
|
30
30
|
grantType: 'password',
|
|
31
|
-
baseUrl: process.env.OIDC_PROVIDER_URL,
|
|
32
|
-
oidcPath: process.env.OIDC_PROVIDER_PATH,
|
|
31
|
+
baseUrl: process.env.OIDC_PROVIDER_URL, // e.g., 'https://keycloak.example.com'
|
|
32
|
+
oidcPath: process.env.OIDC_PROVIDER_PATH, // e.g., '/realms/my-realm'
|
|
33
33
|
clientId: process.env.OIDC_CLIENT_ID,
|
|
34
34
|
clientSecret: process.env.OIDC_CLIENT_SECRET,
|
|
35
35
|
});
|
|
@@ -92,21 +92,21 @@ const tokenSet = await client.getAccessToken({ code: authorizationCode });
|
|
|
92
92
|
|
|
93
93
|
Factory function that initializes the OIDC client for the specified grant type.
|
|
94
94
|
|
|
95
|
-
| Parameter
|
|
96
|
-
|
|
97
|
-
| `grantType`
|
|
98
|
-
| `baseUrl`
|
|
99
|
-
| `oidcPath`
|
|
100
|
-
| `clientId`
|
|
101
|
-
| `clientSecret` | `string`
|
|
102
|
-
| `redirectUri`
|
|
95
|
+
| Parameter | Type | Description |
|
|
96
|
+
| -------------- | --------------------------------------------- | ------------------------------------------ |
|
|
97
|
+
| `grantType` | `'password' \| 'client_credentials' \| 'sso'` | OAuth2 grant type |
|
|
98
|
+
| `baseUrl` | `string` | OIDC provider base URL |
|
|
99
|
+
| `oidcPath` | `string` | OIDC realm path (e.g., `/realms/my-realm`) |
|
|
100
|
+
| `clientId` | `string` | Client ID registered in the OIDC provider |
|
|
101
|
+
| `clientSecret` | `string` | Client secret |
|
|
102
|
+
| `redirectUri` | `string` | Callback URL (for `sso` grant) |
|
|
103
103
|
|
|
104
104
|
### Client Methods
|
|
105
105
|
|
|
106
|
-
| Method
|
|
107
|
-
|
|
108
|
-
| `getAccessToken`
|
|
109
|
-
| `getRefreshToken` | `(tokenSet) => Promise<TokenSet>`
|
|
106
|
+
| Method | Signature | Description |
|
|
107
|
+
| ----------------- | ----------------------------------- | ------------------------------------------------------------ |
|
|
108
|
+
| `getAccessToken` | `(loginData?) => Promise<TokenSet>` | Acquire an access token |
|
|
109
|
+
| `getRefreshToken` | `(tokenSet) => Promise<TokenSet>` | Refresh an existing token set (not for `client_credentials`) |
|
|
110
110
|
|
|
111
111
|
### `TokenSet`
|
|
112
112
|
|
|
@@ -115,7 +115,7 @@ interface TokenSet {
|
|
|
115
115
|
access_token: string;
|
|
116
116
|
token_type: string;
|
|
117
117
|
expires_in: number;
|
|
118
|
-
refresh_token?: string;
|
|
118
|
+
refresh_token?: string; // not present for client_credentials
|
|
119
119
|
refresh_expires_in?: number;
|
|
120
120
|
id_token?: string;
|
|
121
121
|
session_state?: string;
|
|
@@ -125,12 +125,12 @@ interface TokenSet {
|
|
|
125
125
|
|
|
126
126
|
## Environment Variables
|
|
127
127
|
|
|
128
|
-
| Variable
|
|
129
|
-
|
|
130
|
-
| `OIDC_PROVIDER_URL`
|
|
131
|
-
| `OIDC_PROVIDER_PATH` | OIDC realm path (e.g., `/realms/my-realm`)
|
|
132
|
-
| `OIDC_CLIENT_ID`
|
|
133
|
-
| `OIDC_CLIENT_SECRET` | Client secret
|
|
134
|
-
| `OIDC_USERNAME`
|
|
135
|
-
| `OIDC_PASSWORD`
|
|
136
|
-
| `OIDC_CALLBACK_URL`
|
|
128
|
+
| Variable | Description |
|
|
129
|
+
| -------------------- | ------------------------------------------------------------- |
|
|
130
|
+
| `OIDC_PROVIDER_URL` | OIDC provider base URL (e.g., `https://keycloak.example.com`) |
|
|
131
|
+
| `OIDC_PROVIDER_PATH` | OIDC realm path (e.g., `/realms/my-realm`) |
|
|
132
|
+
| `OIDC_CLIENT_ID` | Client ID |
|
|
133
|
+
| `OIDC_CLIENT_SECRET` | Client secret |
|
|
134
|
+
| `OIDC_USERNAME` | Username (for `password` grant) |
|
|
135
|
+
| `OIDC_PASSWORD` | Password (for `password` grant) |
|
|
136
|
+
| `OIDC_CALLBACK_URL` | Redirect URI (for `sso` grant) |
|