@asgardeo/javascript 0.10.2 → 0.12.0
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/dist/AsgardeoJavaScriptClient.d.ts +2 -0
- package/dist/__legacy__/models/client-config.d.ts +7 -0
- package/dist/cjs/index.js +38 -6
- package/dist/cjs/index.js.map +4 -4
- package/dist/constants/v2/OIDCDiscoveryConstants.d.ts +39 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +38 -6
- package/dist/index.js.map +4 -4
- package/dist/models/config.d.ts +105 -0
- package/package.json +1 -1
package/dist/models/config.d.ts
CHANGED
|
@@ -111,6 +111,84 @@ export interface BaseConfig<T = unknown> extends WithPreferences {
|
|
|
111
111
|
* Not recommended for public clients like browser applications.
|
|
112
112
|
*/
|
|
113
113
|
clientSecret?: string | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* OpenID Connect discovery configuration.
|
|
116
|
+
* Controls how the SDK resolves endpoint URLs from the authorization server.
|
|
117
|
+
* Each discovery mechanism is independently configurable.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* // Use a custom well-known discovery document URL
|
|
121
|
+
* discovery: { wellKnown: { endpoint: "https://custom.example.com/.well-known/openid-configuration" } }
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* // Disable well-known discovery entirely
|
|
125
|
+
* discovery: { wellKnown: { enabled: false } }
|
|
126
|
+
*/
|
|
127
|
+
discovery?: {
|
|
128
|
+
/**
|
|
129
|
+
* Configuration for OpenID Connect Discovery via the well-known endpoint (RFC 8414).
|
|
130
|
+
* The SDK fetches `{baseUrl}/oauth2/token/.well-known/openid-configuration` by default.
|
|
131
|
+
*/
|
|
132
|
+
wellKnown?: {
|
|
133
|
+
/**
|
|
134
|
+
* Whether to fetch and use the well-known discovery document to resolve endpoint URLs.
|
|
135
|
+
* @default true
|
|
136
|
+
*/
|
|
137
|
+
enabled?: boolean;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Optional overrides for the OIDC protocol endpoints.
|
|
142
|
+
* By default, the SDK derives all endpoint URLs from the well-known discovery document
|
|
143
|
+
* located at `{baseUrl}/oauth2/token/.well-known/openid-configuration`.
|
|
144
|
+
* Use this when your authorization server exposes endpoints at non-standard paths,
|
|
145
|
+
* or when a custom domain differs from `baseUrl`.
|
|
146
|
+
*
|
|
147
|
+
* Individual overrides take precedence over values resolved from the discovery document.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* endpoints: {
|
|
151
|
+
* wellKnown: "https://custom-domain.example.com/.well-known/openid-configuration",
|
|
152
|
+
* authorization: "https://custom-domain.example.com/oauth2/authorize",
|
|
153
|
+
* }
|
|
154
|
+
*/
|
|
155
|
+
endpoints?: {
|
|
156
|
+
/**
|
|
157
|
+
* The authorization endpoint URL.
|
|
158
|
+
* If not provided, resolved from the well-known discovery document.
|
|
159
|
+
*/
|
|
160
|
+
authorization?: string;
|
|
161
|
+
/**
|
|
162
|
+
* The end-session (logout) endpoint URL.
|
|
163
|
+
* If not provided, resolved from the well-known discovery document.
|
|
164
|
+
*/
|
|
165
|
+
endSession?: string;
|
|
166
|
+
/**
|
|
167
|
+
* The introspection endpoint URL.
|
|
168
|
+
* If not provided, resolved from the well-known discovery document.
|
|
169
|
+
*/
|
|
170
|
+
introspection?: string;
|
|
171
|
+
/**
|
|
172
|
+
* The JSON Web Key Set (JWKS) endpoint URL used to fetch public keys for token verification.
|
|
173
|
+
* If not provided, resolved from the well-known discovery document.
|
|
174
|
+
*/
|
|
175
|
+
jwks?: string;
|
|
176
|
+
/**
|
|
177
|
+
* The token endpoint URL.
|
|
178
|
+
* If not provided, resolved from the well-known discovery document.
|
|
179
|
+
*/
|
|
180
|
+
token?: string;
|
|
181
|
+
/**
|
|
182
|
+
* The userinfo endpoint URL.
|
|
183
|
+
* If not provided, resolved from the well-known discovery document.
|
|
184
|
+
*/
|
|
185
|
+
userInfo?: string;
|
|
186
|
+
/**
|
|
187
|
+
* The OpenID Connect discovery document URL.
|
|
188
|
+
* Defaults to `{baseUrl}/oauth2/token/.well-known/openid-configuration`.
|
|
189
|
+
*/
|
|
190
|
+
wellKnown?: string;
|
|
191
|
+
};
|
|
114
192
|
/**
|
|
115
193
|
* Optional instance ID for multi-auth context support.
|
|
116
194
|
* Use this when you need multiple authentication contexts in the same application.
|
|
@@ -314,6 +392,27 @@ export interface I18nPreferences {
|
|
|
314
392
|
*/
|
|
315
393
|
urlParam?: string | false;
|
|
316
394
|
}
|
|
395
|
+
export interface UserPreferences {
|
|
396
|
+
/**
|
|
397
|
+
* Whether to automatically fetch the user's associated organizations after sign-in.
|
|
398
|
+
* When set to false, the SDK will not make API calls to `/api/users/v1/me/organizations`.
|
|
399
|
+
* @default true
|
|
400
|
+
* @remarks Disabling this will improve performance if you don't need organization information.
|
|
401
|
+
* You can manually call `getMyOrganizations()` when needed if this is disabled.
|
|
402
|
+
*/
|
|
403
|
+
fetchOrganizations?: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Whether to automatically fetch the user profile from SCIM2 endpoints after sign-in.
|
|
406
|
+
* When set to false, the SDK will not make API calls to `/scim2/Me` and `/scim2/Schemas`.
|
|
407
|
+
* Instead, it will extract basic user claims from the ID token.
|
|
408
|
+
* @default true
|
|
409
|
+
* @remarks Disabling this will improve performance but provide limited user profile information.
|
|
410
|
+
* Only the claims present in the ID token will be available (e.g., sub, email, name).
|
|
411
|
+
* For full user profile attributes (custom claims, enterprise attributes, etc.),
|
|
412
|
+
* keep this enabled or manually call `getUserProfile()` when needed.
|
|
413
|
+
*/
|
|
414
|
+
fetchUserProfile?: boolean;
|
|
415
|
+
}
|
|
317
416
|
export interface Preferences {
|
|
318
417
|
/**
|
|
319
418
|
* Internationalization preferences for the Asgardeo UI components
|
|
@@ -328,4 +427,10 @@ export interface Preferences {
|
|
|
328
427
|
* Theme preferences for the Asgardeo UI components
|
|
329
428
|
*/
|
|
330
429
|
theme?: ThemePreferences;
|
|
430
|
+
/**
|
|
431
|
+
* User profile preferences for controlling user data fetching behavior.
|
|
432
|
+
* TEMPORARY CONFIG
|
|
433
|
+
* TODO: Remove this once https://github.com/asgardeo/javascript/issues/412 is properly fixed.
|
|
434
|
+
*/
|
|
435
|
+
user?: UserPreferences;
|
|
331
436
|
}
|