@apicurio/common-ui-components 2.0.16 → 2.1.1
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/auth/AuthConfigContext.d.ts +51 -0
- package/dist/main.js +418 -359
- package/package.json +1 -1
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC configuration options
|
|
3
|
+
*/
|
|
4
|
+
export interface OidcAuthOptions {
|
|
5
|
+
url: string;
|
|
6
|
+
clientId: string;
|
|
7
|
+
redirectUri: string;
|
|
8
|
+
scope?: string;
|
|
9
|
+
logoutUrl?: string;
|
|
10
|
+
loadUserInfo?: boolean;
|
|
11
|
+
logTokens?: boolean;
|
|
12
|
+
tokenType?: "id" | "access";
|
|
13
|
+
/**
|
|
14
|
+
* Enable state-based redirection after OIDC authentication.
|
|
15
|
+
* When enabled, the user's location before authentication is stored in session storage
|
|
16
|
+
* and they are redirected back to that location after successful authentication.
|
|
17
|
+
* This is required for OIDC providers like Microsoft EntraID that don't support
|
|
18
|
+
* dynamic redirect URIs.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
useStateBasedRedirect?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum age in milliseconds for stored state entries in session storage.
|
|
24
|
+
* State entries older than this will be cleaned up automatically.
|
|
25
|
+
* Only applies when useStateBasedRedirect is enabled.
|
|
26
|
+
* @default 300000 (5 minutes)
|
|
27
|
+
*/
|
|
28
|
+
stateMaxAge?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Custom redirect handler for client-side navigation after OIDC authentication.
|
|
31
|
+
* This allows React Router or other routing libraries to handle navigation
|
|
32
|
+
* without causing a full page refresh.
|
|
33
|
+
*
|
|
34
|
+
* If not provided, defaults to `window.location.href = location` which causes
|
|
35
|
+
* a full page reload.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* // With React Router v6
|
|
39
|
+
* import { useNavigate } from 'react-router-dom';
|
|
40
|
+
*
|
|
41
|
+
* const navigate = useNavigate();
|
|
42
|
+
* const authConfig = {
|
|
43
|
+
* type: "oidc",
|
|
44
|
+
* options: {
|
|
45
|
+
* // ... other options
|
|
46
|
+
* onRedirect: (location) => navigate(location)
|
|
47
|
+
* }
|
|
48
|
+
* };
|
|
49
|
+
*/
|
|
50
|
+
onRedirect?: (location: string) => void;
|
|
51
|
+
}
|
|
1
52
|
export interface AuthConfig {
|
|
2
53
|
type: "none" | "basic" | "oidc";
|
|
3
54
|
options?: any;
|