@asgardeo/javascript 0.1.0 → 0.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/AsgardeoJavaScriptClient.d.ts +16 -50
- package/dist/IsomorphicCrypto.d.ts +2 -2
- package/dist/StorageManager.d.ts +1 -1
- package/dist/__legacy__/client.d.ts +2 -2
- package/dist/__legacy__/helpers/authentication-helper.d.ts +3 -3
- package/dist/api/createOrganization.d.ts +129 -0
- package/dist/api/executeEmbeddedSignInFlow.d.ts +21 -0
- package/dist/api/executeEmbeddedSignUpFlow.d.ts +44 -0
- package/dist/api/getAllOrganizations.d.ts +112 -0
- package/dist/api/getMeOrganizations.d.ts +119 -0
- package/dist/api/getOrganization.d.ts +109 -0
- package/dist/api/getSchemas.d.ts +89 -0
- package/dist/api/getScim2Me.d.ts +89 -0
- package/dist/api/initializeEmbeddedSignInFlow.d.ts +51 -0
- package/dist/api/updateMeProfile.d.ts +82 -0
- package/dist/api/updateOrganization.d.ts +118 -0
- package/dist/cjs/index.js +966 -146
- package/dist/cjs/index.js.map +4 -4
- package/dist/constants/OIDCRequestConstants.d.ts +1 -1
- package/dist/constants/ScopeConstants.d.ts +3 -6
- package/dist/constants/TokenExchangeConstants.d.ts +2 -2
- package/dist/constants/VendorConstants.d.ts +31 -0
- package/dist/index.d.ts +20 -5
- package/dist/index.js +939 -137
- package/dist/index.js.map +4 -4
- package/dist/models/client.d.ts +52 -3
- package/dist/models/config.d.ts +36 -12
- package/dist/models/embedded-flow.d.ts +66 -0
- package/dist/models/embedded-signin-flow.d.ts +99 -0
- package/dist/models/flow.d.ts +30 -0
- package/dist/models/i18n.d.ts +24 -0
- package/dist/models/organization.d.ts +24 -0
- package/dist/models/token.d.ts +42 -30
- package/dist/theme/createTheme.d.ts +1 -1
- package/dist/theme/types.d.ts +29 -16
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts +2 -2
- package/dist/utils/extractUserClaimsFromIdToken.d.ts +2 -2
- package/dist/utils/generateFlattenedUserProfile.d.ts +9 -2
- package/dist/utils/isEmpty.d.ts +48 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts +32 -0
- package/package.json +1 -1
- package/dist/api/handleApplicationNativeAuthentication.d.ts +0 -33
- package/dist/api/initializeApplicationNativeAuthentication.d.ts +0 -117
- package/dist/models/application-native-authentication.d.ts +0 -82
package/dist/models/client.d.ts
CHANGED
|
@@ -15,9 +15,13 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
+
import { EmbeddedFlowExecuteRequestConfig, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse } from './embedded-flow';
|
|
19
|
+
import { EmbeddedSignInFlowHandleRequestPayload } from './embedded-signin-flow';
|
|
20
|
+
import { Organization } from './organization';
|
|
18
21
|
import { User, UserProfile } from './user';
|
|
19
22
|
export type SignInOptions = Record<string, unknown>;
|
|
20
23
|
export type SignOutOptions = Record<string, unknown>;
|
|
24
|
+
export type SignUpOptions = Record<string, unknown>;
|
|
21
25
|
/**
|
|
22
26
|
* Interface defining the core functionality for Asgardeo authentication clients.
|
|
23
27
|
*
|
|
@@ -29,6 +33,25 @@ export type SignOutOptions = Record<string, unknown>;
|
|
|
29
33
|
* ```
|
|
30
34
|
*/
|
|
31
35
|
export interface AsgardeoClient<T> {
|
|
36
|
+
/**
|
|
37
|
+
* Gets the users associated organizations.
|
|
38
|
+
*
|
|
39
|
+
* @returns Associated organizations.
|
|
40
|
+
*/
|
|
41
|
+
getOrganizations(): Promise<Organization[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the current organization of the user.
|
|
44
|
+
*
|
|
45
|
+
* @returns The current organization if available, otherwise null.
|
|
46
|
+
*/
|
|
47
|
+
getCurrentOrganization(): Promise<Organization | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Switches the current organization to the specified one.
|
|
50
|
+
* @param organization - The organization to switch to.
|
|
51
|
+
* @returns A promise that resolves when the switch is complete.
|
|
52
|
+
*/
|
|
53
|
+
switchOrganization(organization: Organization): Promise<void>;
|
|
54
|
+
getConfiguration(): T;
|
|
32
55
|
/**
|
|
33
56
|
* Gets user information from the session.
|
|
34
57
|
*
|
|
@@ -66,9 +89,21 @@ export interface AsgardeoClient<T> {
|
|
|
66
89
|
* Initiates the sign-in process for the user.
|
|
67
90
|
*
|
|
68
91
|
* @param options - Optional sign-in options like additional parameters to be sent in the authorize request, etc.
|
|
92
|
+
* @param sessionId - Optional session ID to be used for sign-in.
|
|
93
|
+
* @param onSignInSuccess - Callback function to be executed upon successful sign-in.
|
|
69
94
|
* @returns Promise resolving the user upon successful sign in.
|
|
70
95
|
*/
|
|
71
|
-
signIn(options?: SignInOptions): Promise<User>;
|
|
96
|
+
signIn(options?: SignInOptions, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
97
|
+
/**
|
|
98
|
+
* Initiates an embedded (App-Native) sign-in flow for the user.
|
|
99
|
+
*
|
|
100
|
+
* @param payload - The payload containing the necessary information to execute the embedded sign-in flow.
|
|
101
|
+
* @param request - The request object containing URL and parameters for the sign-in flow HTTP request.
|
|
102
|
+
* @param sessionId - Optional session ID to be used for sign-in.
|
|
103
|
+
* @param onSignInSuccess - Callback function to be executed upon successful sign-in.
|
|
104
|
+
* @returns A promise that resolves to an EmbeddedFlowExecuteResponse containing the flow execution details.
|
|
105
|
+
*/
|
|
106
|
+
signIn(payload: EmbeddedSignInFlowHandleRequestPayload, request: EmbeddedFlowExecuteRequestConfig<EmbeddedSignInFlowHandleRequestPayload>, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
72
107
|
/**
|
|
73
108
|
* Signs out the currently signed-in user.
|
|
74
109
|
*
|
|
@@ -76,7 +111,7 @@ export interface AsgardeoClient<T> {
|
|
|
76
111
|
* @param afterSignOut - Callback function to be executed after sign-out is complete.
|
|
77
112
|
* @returns A promise that resolves to true if sign-out is successful
|
|
78
113
|
*/
|
|
79
|
-
signOut(options?: SignOutOptions, afterSignOut?: (
|
|
114
|
+
signOut(options?: SignOutOptions, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;
|
|
80
115
|
/**
|
|
81
116
|
* Signs out the currently signed-in user with an optional session ID.
|
|
82
117
|
*
|
|
@@ -86,5 +121,19 @@ export interface AsgardeoClient<T> {
|
|
|
86
121
|
* @param afterSignOut - Callback function to be executed after sign-out is complete.
|
|
87
122
|
* @returns A promise that resolves to true if sign-out is successful
|
|
88
123
|
*/
|
|
89
|
-
signOut(options?: SignOutOptions, sessionId?: string, afterSignOut?: (
|
|
124
|
+
signOut(options?: SignOutOptions, sessionId?: string, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;
|
|
125
|
+
/**
|
|
126
|
+
* Initiates a redirection-based sign-up process for the user.
|
|
127
|
+
*
|
|
128
|
+
* @param options - Optional sign-up options like additional parameters to be sent in the sign-up request, etc.
|
|
129
|
+
* @returns Promise resolving to the user upon successful sign up.
|
|
130
|
+
*/
|
|
131
|
+
signUp(options?: SignUpOptions): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Initiates an embedded (App-Native) sign-up flow for the user.
|
|
134
|
+
*
|
|
135
|
+
* @param payload - The payload containing the necessary information to execute the embedded sign-up flow.
|
|
136
|
+
* @returns A promise that resolves to an EmbeddedFlowExecuteResponse containing the flow execution details.
|
|
137
|
+
*/
|
|
138
|
+
signUp(payload: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse>;
|
|
90
139
|
}
|
package/dist/models/config.d.ts
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { ThemeConfig, ThemeMode } from '../theme/types';
|
|
19
18
|
import { I18nBundle } from './i18n';
|
|
20
19
|
import { RecursivePartial } from './utility-types';
|
|
20
|
+
import { ThemeConfig, ThemeMode } from '../theme/types';
|
|
21
21
|
export interface BaseConfig<T = unknown> extends WithPreferences {
|
|
22
22
|
/**
|
|
23
23
|
* Optional URL where the authorization server should redirect after authentication.
|
|
@@ -29,6 +29,17 @@ export interface BaseConfig<T = unknown> extends WithPreferences {
|
|
|
29
29
|
* For production: "https://your-app.com/api/auth/callback"
|
|
30
30
|
*/
|
|
31
31
|
afterSignInUrl?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Optional URL where the authorization server should redirect after sign out.
|
|
34
|
+
* This must match one of the allowed post logout redirect URIs configured in your IdP
|
|
35
|
+
* and is used to redirect the user after they have signed out.
|
|
36
|
+
* If not provided, the framework layer will use the default sign out URL based on the
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* For development: "http://localhost:3000/api/auth/signout"
|
|
40
|
+
* For production: "https://your-app.com/api/auth/signout"
|
|
41
|
+
*/
|
|
42
|
+
afterSignOutUrl?: string | undefined;
|
|
32
43
|
/**
|
|
33
44
|
* The base URL of the Asgardeo identity server.
|
|
34
45
|
* Example: "https://api.asgardeo.io/t/{org_name}"
|
|
@@ -58,6 +69,19 @@ export interface BaseConfig<T = unknown> extends WithPreferences {
|
|
|
58
69
|
* scopes: ["openid", "profile", "email"]
|
|
59
70
|
*/
|
|
60
71
|
scopes?: string | string[] | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Optional URL to redirect the user to sign-in.
|
|
74
|
+
* By default, this will be the sign-in page of Asgardeo.
|
|
75
|
+
* If you want to use a custom sign-in page, you can provide the URL here and use the `SignIn` component to render it.
|
|
76
|
+
*/
|
|
77
|
+
signInUrl?: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Optional URL to redirect the user to sign-up.
|
|
80
|
+
* By default, this will be the sign-up page of Asgardeo.
|
|
81
|
+
* If you want to use a custom sign-up page, you can provide the URL here
|
|
82
|
+
* and use the `SignUp` component to render it.
|
|
83
|
+
*/
|
|
84
|
+
signUpUrl?: string | undefined;
|
|
61
85
|
}
|
|
62
86
|
export interface WithPreferences {
|
|
63
87
|
/**
|
|
@@ -78,29 +102,29 @@ export interface ThemePreferences {
|
|
|
78
102
|
}
|
|
79
103
|
export interface I18nPreferences {
|
|
80
104
|
/**
|
|
81
|
-
*
|
|
82
|
-
* Defaults to the browser's default language.
|
|
105
|
+
* Custom translations to override default ones.
|
|
83
106
|
*/
|
|
84
|
-
|
|
107
|
+
bundles?: {
|
|
108
|
+
[key: string]: I18nBundle;
|
|
109
|
+
};
|
|
85
110
|
/**
|
|
86
111
|
* The fallback language to use if translations are not available in the specified language.
|
|
87
112
|
* Defaults to 'en-US'.
|
|
88
113
|
*/
|
|
89
114
|
fallbackLanguage?: string;
|
|
90
115
|
/**
|
|
91
|
-
*
|
|
116
|
+
* The language to use for translations.
|
|
117
|
+
* Defaults to the browser's default language.
|
|
92
118
|
*/
|
|
93
|
-
|
|
94
|
-
[key: string]: I18nBundle;
|
|
95
|
-
};
|
|
119
|
+
language?: string;
|
|
96
120
|
}
|
|
97
121
|
export interface Preferences {
|
|
98
|
-
/**
|
|
99
|
-
* Theme preferences for the Asgardeo UI components
|
|
100
|
-
*/
|
|
101
|
-
theme?: ThemePreferences;
|
|
102
122
|
/**
|
|
103
123
|
* Internationalization preferences for the Asgardeo UI components
|
|
104
124
|
*/
|
|
105
125
|
i18n?: I18nPreferences;
|
|
126
|
+
/**
|
|
127
|
+
* Theme preferences for the Asgardeo UI components
|
|
128
|
+
*/
|
|
129
|
+
theme?: ThemePreferences;
|
|
106
130
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
export declare enum EmbeddedFlowType {
|
|
19
|
+
Registration = "REGISTRATION"
|
|
20
|
+
}
|
|
21
|
+
export interface EmbeddedFlowExecuteRequestPayload {
|
|
22
|
+
actionId?: string;
|
|
23
|
+
flowType: EmbeddedFlowType;
|
|
24
|
+
inputs?: Record<string, any>;
|
|
25
|
+
}
|
|
26
|
+
export interface EmbeddedFlowExecuteResponse {
|
|
27
|
+
data: EmbeddedSignUpFlowData;
|
|
28
|
+
flowId: string;
|
|
29
|
+
flowStatus: EmbeddedFlowStatus;
|
|
30
|
+
type: EmbeddedFlowResponseType;
|
|
31
|
+
}
|
|
32
|
+
export declare enum EmbeddedFlowStatus {
|
|
33
|
+
Complete = "COMPLETE",
|
|
34
|
+
Incomplete = "INCOMPLETE"
|
|
35
|
+
}
|
|
36
|
+
export declare enum EmbeddedFlowResponseType {
|
|
37
|
+
Redirection = "REDIRECTION",
|
|
38
|
+
View = "VIEW"
|
|
39
|
+
}
|
|
40
|
+
export interface EmbeddedSignUpFlowData {
|
|
41
|
+
components?: EmbeddedFlowComponent[];
|
|
42
|
+
redirectURL?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface EmbeddedFlowComponent {
|
|
45
|
+
components: EmbeddedFlowComponent[];
|
|
46
|
+
config: Record<string, any>;
|
|
47
|
+
id: string;
|
|
48
|
+
type: EmbeddedFlowComponentType;
|
|
49
|
+
variant?: string;
|
|
50
|
+
}
|
|
51
|
+
export declare enum EmbeddedFlowComponentType {
|
|
52
|
+
Button = "BUTTON",
|
|
53
|
+
Checkbox = "CHECKBOX",
|
|
54
|
+
Divider = "DIVIDER",
|
|
55
|
+
Form = "FORM",
|
|
56
|
+
Image = "IMAGE",
|
|
57
|
+
Input = "INPUT",
|
|
58
|
+
Radio = "RADIO",
|
|
59
|
+
Select = "SELECT",
|
|
60
|
+
Typography = "TYPOGRAPHY"
|
|
61
|
+
}
|
|
62
|
+
export interface EmbeddedFlowExecuteRequestConfig<T = any> extends Partial<Request> {
|
|
63
|
+
baseUrl?: string;
|
|
64
|
+
payload?: T;
|
|
65
|
+
url?: string;
|
|
66
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
export interface EmbeddedSignInFlowInitiateResponse {
|
|
19
|
+
flowId: string;
|
|
20
|
+
flowStatus: EmbeddedSignInFlowStatus;
|
|
21
|
+
flowType: EmbeddedSignInFlowType;
|
|
22
|
+
links: EmbeddedSignInFlowLink[];
|
|
23
|
+
nextStep: {
|
|
24
|
+
authenticators: EmbeddedSignInFlowAuthenticator[];
|
|
25
|
+
stepType: EmbeddedSignInFlowStepType;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export declare enum EmbeddedSignInFlowStatus {
|
|
29
|
+
FailCompleted = "FAIL_COMPLETED",
|
|
30
|
+
FailIncomplete = "FAIL_INCOMPLETE",
|
|
31
|
+
Incomplete = "INCOMPLETE",
|
|
32
|
+
SuccessCompleted = "SUCCESS_COMPLETED"
|
|
33
|
+
}
|
|
34
|
+
export declare enum EmbeddedSignInFlowType {
|
|
35
|
+
Authentication = "AUTHENTICATION"
|
|
36
|
+
}
|
|
37
|
+
export declare enum EmbeddedSignInFlowStepType {
|
|
38
|
+
AuthenticatorPrompt = "AUTHENTICATOR_PROMPT",
|
|
39
|
+
MultiOptionsPrompt = "MULTI_OPTIONS_PROMPT"
|
|
40
|
+
}
|
|
41
|
+
export interface EmbeddedSignInFlowAuthenticator {
|
|
42
|
+
authenticator: string;
|
|
43
|
+
authenticatorId: string;
|
|
44
|
+
idp: string;
|
|
45
|
+
metadata: {
|
|
46
|
+
i18nKey: string;
|
|
47
|
+
params: {
|
|
48
|
+
confidential: boolean;
|
|
49
|
+
displayName: string;
|
|
50
|
+
i18nKey: string;
|
|
51
|
+
order: number;
|
|
52
|
+
param: string;
|
|
53
|
+
type: EmbeddedSignInFlowAuthenticatorParamType;
|
|
54
|
+
}[];
|
|
55
|
+
promptType: EmbeddedSignInFlowAuthenticatorPromptType;
|
|
56
|
+
};
|
|
57
|
+
requiredParams: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface EmbeddedSignInFlowLink {
|
|
60
|
+
href: string;
|
|
61
|
+
method: string;
|
|
62
|
+
name: string;
|
|
63
|
+
}
|
|
64
|
+
export interface EmbeddedSignInFlowHandleRequestPayload {
|
|
65
|
+
flowId: string;
|
|
66
|
+
selectedAuthenticator: {
|
|
67
|
+
authenticatorId: string;
|
|
68
|
+
params: Record<string, string>;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface EmbeddedSignInFlowHandleResponse {
|
|
72
|
+
authData: Record<string, any>;
|
|
73
|
+
flowStatus: string;
|
|
74
|
+
}
|
|
75
|
+
export declare enum EmbeddedSignInFlowAuthenticatorParamType {
|
|
76
|
+
Integer = "INTEGER",
|
|
77
|
+
MultiValued = "MULTI_VALUED",
|
|
78
|
+
String = "STRING"
|
|
79
|
+
}
|
|
80
|
+
export declare enum EmbeddedSignInFlowAuthenticatorExtendedParamType {
|
|
81
|
+
Otp = "OTPCode"
|
|
82
|
+
}
|
|
83
|
+
export declare enum EmbeddedSignInFlowAuthenticatorKnownIdPType {
|
|
84
|
+
Local = "LOCAL"
|
|
85
|
+
}
|
|
86
|
+
export declare enum EmbeddedSignInFlowAuthenticatorPromptType {
|
|
87
|
+
/**
|
|
88
|
+
* Prompt for internal system use, such as API keys or tokens.
|
|
89
|
+
*/
|
|
90
|
+
InternalPrompt = "INTERNAL_PROMPT",
|
|
91
|
+
/**
|
|
92
|
+
* Prompt for redirection to another page or service.
|
|
93
|
+
*/
|
|
94
|
+
RedirectionPrompt = "REDIRECTION_PROMPT",
|
|
95
|
+
/**
|
|
96
|
+
* Prompt for user input, typically for username/password or similar credentials.
|
|
97
|
+
*/
|
|
98
|
+
UserPrompt = "USER_PROMPT"
|
|
99
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
export declare enum FlowMode {
|
|
19
|
+
/**
|
|
20
|
+
* This mode is suitable for embedded sign-in, sign-up, etc. flows where the authentication
|
|
21
|
+
* UIs are rendered within the application.
|
|
22
|
+
* @see {@link https://is.docs.wso2.com/en/7.1.0/references/app-native-authentication/}
|
|
23
|
+
*/
|
|
24
|
+
Embedded = "DIRECT",
|
|
25
|
+
/**
|
|
26
|
+
* Traditional redirect based sign-in, sign-up, etc. flows where the authentication
|
|
27
|
+
* UIs are from a external Identity Provider (ex: WSO2 Identity Server or Asgardeo).
|
|
28
|
+
*/
|
|
29
|
+
Redirect = "REDIRECTION"
|
|
30
|
+
}
|
package/dist/models/i18n.d.ts
CHANGED
|
@@ -29,6 +29,9 @@ export interface I18nTranslations {
|
|
|
29
29
|
'elements.buttons.social': string;
|
|
30
30
|
'elements.fields.placeholder': string;
|
|
31
31
|
'signin.title': string;
|
|
32
|
+
'signin.subtitle': string;
|
|
33
|
+
'signup.title': string;
|
|
34
|
+
'signup.subtitle': string;
|
|
32
35
|
'email.otp.title': string;
|
|
33
36
|
'email.otp.subtitle': string;
|
|
34
37
|
'email.otp.submit.button': string;
|
|
@@ -44,6 +47,27 @@ export interface I18nTranslations {
|
|
|
44
47
|
'username.password.submit.button': string;
|
|
45
48
|
'username.password.title': string;
|
|
46
49
|
'username.password.subtitle': string;
|
|
50
|
+
'organization.switcher.select.organization': string;
|
|
51
|
+
'organization.switcher.switch.organization': string;
|
|
52
|
+
'organization.switcher.loading.organizations': string;
|
|
53
|
+
'organization.switcher.members': string;
|
|
54
|
+
'organization.switcher.member': string;
|
|
55
|
+
'organization.switcher.create.organization': string;
|
|
56
|
+
'organization.switcher.manage.organizations': string;
|
|
57
|
+
'organization.switcher.manage.button': string;
|
|
58
|
+
'organization.profile.title': string;
|
|
59
|
+
'organization.profile.loading': string;
|
|
60
|
+
'organization.profile.error': string;
|
|
61
|
+
'organization.create.title': string;
|
|
62
|
+
'organization.create.name.label': string;
|
|
63
|
+
'organization.create.name.placeholder': string;
|
|
64
|
+
'organization.create.handle.label': string;
|
|
65
|
+
'organization.create.handle.placeholder': string;
|
|
66
|
+
'organization.create.description.label': string;
|
|
67
|
+
'organization.create.description.placeholder': string;
|
|
68
|
+
'organization.create.button': string;
|
|
69
|
+
'organization.create.creating': string;
|
|
70
|
+
'organization.create.cancel': string;
|
|
47
71
|
'messages.loading': string;
|
|
48
72
|
'errors.title': string;
|
|
49
73
|
'errors.sign.in.initialization': string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
export interface Organization {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
orgHandle: string;
|
|
22
|
+
ref?: string;
|
|
23
|
+
status?: string;
|
|
24
|
+
}
|
package/dist/models/token.d.ts
CHANGED
|
@@ -31,11 +31,11 @@ export interface TokenResponse {
|
|
|
31
31
|
*/
|
|
32
32
|
accessToken: string;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* Unix timestamp (in seconds) when the token was created.
|
|
35
|
+
* Used in combination with expiresIn to determine when
|
|
36
|
+
* the token needs to be refreshed.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
createdAt: number;
|
|
39
39
|
/**
|
|
40
40
|
* Duration in seconds until the access token expires.
|
|
41
41
|
* Applications should refresh the token before this time
|
|
@@ -43,29 +43,29 @@ export interface TokenResponse {
|
|
|
43
43
|
*/
|
|
44
44
|
expiresIn: string;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* JSON Web Token (JWT) containing user identity information.
|
|
47
|
+
* This token can be decoded to access user claims and metadata
|
|
48
|
+
* without additional server requests.
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
idToken: string;
|
|
51
51
|
/**
|
|
52
52
|
* Token used to obtain new access tokens without re-authentication.
|
|
53
53
|
* Store this securely as it enables long-term access to the user's
|
|
54
54
|
* account through the refresh flow.
|
|
55
55
|
*/
|
|
56
56
|
refreshToken: string;
|
|
57
|
+
/**
|
|
58
|
+
* Space-separated list of OAuth scopes granted to the application.
|
|
59
|
+
* These scopes determine what resources and actions the application
|
|
60
|
+
* has permission to access.
|
|
61
|
+
*/
|
|
62
|
+
scope: string;
|
|
57
63
|
/**
|
|
58
64
|
* The type of token issued, typically "Bearer".
|
|
59
65
|
* This indicates how the token should be used in
|
|
60
66
|
* API request Authorization headers.
|
|
61
67
|
*/
|
|
62
68
|
tokenType: string;
|
|
63
|
-
/**
|
|
64
|
-
* Unix timestamp (in seconds) when the token was created.
|
|
65
|
-
* Used in combination with expiresIn to determine when
|
|
66
|
-
* the token needs to be refreshed.
|
|
67
|
-
*/
|
|
68
|
-
createdAt: number;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Represents the raw token response received directly from the authentication server.
|
|
@@ -82,18 +82,18 @@ export interface AccessTokenApiResponse {
|
|
|
82
82
|
* before any processing or validation.
|
|
83
83
|
*/
|
|
84
84
|
access_token: string;
|
|
85
|
-
/**
|
|
86
|
-
* Raw expiration time in seconds.
|
|
87
|
-
* Indicates how long the access token will be valid
|
|
88
|
-
* from the time it was issued.
|
|
89
|
-
*/
|
|
90
|
-
expires_in: string;
|
|
91
85
|
/**
|
|
92
86
|
* Server-provided creation timestamp in Unix seconds.
|
|
93
87
|
* Used to track when the token was originally issued
|
|
94
88
|
* and calculate absolute expiration time.
|
|
95
89
|
*/
|
|
96
90
|
created_at: number;
|
|
91
|
+
/**
|
|
92
|
+
* Raw expiration time in seconds.
|
|
93
|
+
* Indicates how long the access token will be valid
|
|
94
|
+
* from the time it was issued.
|
|
95
|
+
*/
|
|
96
|
+
expires_in: string;
|
|
97
97
|
/**
|
|
98
98
|
* Raw ID token string containing encoded user information.
|
|
99
99
|
* This JWT can be decoded to access standardized claims
|
|
@@ -122,27 +122,39 @@ export interface AccessTokenApiResponse {
|
|
|
122
122
|
/**
|
|
123
123
|
* Interface for the standard (required) claims of an ID Token payload.
|
|
124
124
|
*/
|
|
125
|
-
export interface
|
|
125
|
+
export interface KnownIdToken {
|
|
126
126
|
/**
|
|
127
127
|
* The audience for which this token is intended.
|
|
128
128
|
*/
|
|
129
129
|
aud: string | string[];
|
|
130
130
|
/**
|
|
131
|
-
* The
|
|
131
|
+
* The email of the user.
|
|
132
132
|
*/
|
|
133
|
-
|
|
133
|
+
email?: string;
|
|
134
134
|
/**
|
|
135
135
|
* The issuer identifier for the issuer of the response.
|
|
136
136
|
*/
|
|
137
137
|
iss: string;
|
|
138
138
|
/**
|
|
139
|
-
* The
|
|
139
|
+
* The unique human readable slug of the organization to which the user belongs.
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
org_handle?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The unique identifier of the organization to which the user belongs.
|
|
144
|
+
*/
|
|
145
|
+
org_id?: string;
|
|
146
|
+
/**
|
|
147
|
+
* The human readable name of the organization to which the user belongs.
|
|
148
|
+
*/
|
|
149
|
+
org_name?: string;
|
|
142
150
|
/**
|
|
143
151
|
* The username the user prefers to be called.
|
|
144
152
|
*/
|
|
145
153
|
preferred_username?: string;
|
|
154
|
+
/**
|
|
155
|
+
* The unique identifier of the user to whom the ID token belongs.
|
|
156
|
+
*/
|
|
157
|
+
sub: string;
|
|
146
158
|
/**
|
|
147
159
|
* The tenant domain of the user.
|
|
148
160
|
*/
|
|
@@ -151,18 +163,18 @@ export interface IdTokenPayloadStandardClaims {
|
|
|
151
163
|
/**
|
|
152
164
|
* Interface for ID Token payload including custom claims.
|
|
153
165
|
*/
|
|
154
|
-
export interface
|
|
166
|
+
export interface IdToken extends KnownIdToken {
|
|
155
167
|
/**
|
|
156
168
|
* Other custom claims.
|
|
157
169
|
*/
|
|
158
170
|
[claim: string]: any;
|
|
159
171
|
}
|
|
160
172
|
export interface TokenExchangeRequestConfig {
|
|
161
|
-
id: string;
|
|
162
|
-
data: any;
|
|
163
|
-
signInRequired: boolean;
|
|
164
173
|
attachToken: boolean;
|
|
174
|
+
data: any;
|
|
175
|
+
id: string;
|
|
165
176
|
returnsSession: boolean;
|
|
166
|
-
tokenEndpoint?: string;
|
|
167
177
|
shouldReplayAfterRefresh?: boolean;
|
|
178
|
+
signInRequired: boolean;
|
|
179
|
+
tokenEndpoint?: string;
|
|
168
180
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { RecursivePartial } from '../models/utility-types';
|
|
19
18
|
import { Theme, ThemeConfig } from './types';
|
|
19
|
+
import { RecursivePartial } from '../models/utility-types';
|
|
20
20
|
declare const createTheme: (config?: RecursivePartial<ThemeConfig>, isDark?: boolean) => Theme;
|
|
21
21
|
export default createTheme;
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -16,40 +16,53 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
export interface ThemeColors {
|
|
19
|
-
|
|
19
|
+
background: {
|
|
20
|
+
body: {
|
|
21
|
+
main: string;
|
|
22
|
+
};
|
|
23
|
+
disabled: string;
|
|
24
|
+
surface: string;
|
|
25
|
+
};
|
|
26
|
+
border: string;
|
|
27
|
+
error: {
|
|
28
|
+
contrastText: string;
|
|
20
29
|
main: string;
|
|
30
|
+
};
|
|
31
|
+
primary: {
|
|
21
32
|
contrastText: string;
|
|
33
|
+
main: string;
|
|
22
34
|
};
|
|
23
35
|
secondary: {
|
|
24
|
-
main: string;
|
|
25
36
|
contrastText: string;
|
|
37
|
+
main: string;
|
|
26
38
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
body: {
|
|
31
|
-
main: string;
|
|
32
|
-
};
|
|
39
|
+
success: {
|
|
40
|
+
contrastText: string;
|
|
41
|
+
main: string;
|
|
33
42
|
};
|
|
34
43
|
text: {
|
|
35
44
|
primary: string;
|
|
36
45
|
secondary: string;
|
|
37
46
|
};
|
|
38
|
-
|
|
39
|
-
error: {
|
|
40
|
-
main: string;
|
|
47
|
+
warning: {
|
|
41
48
|
contrastText: string;
|
|
49
|
+
main: string;
|
|
42
50
|
};
|
|
43
51
|
}
|
|
44
52
|
export interface ThemeConfig {
|
|
45
|
-
colors: ThemeColors;
|
|
46
|
-
spacing: {
|
|
47
|
-
unit: number;
|
|
48
|
-
};
|
|
49
53
|
borderRadius: {
|
|
50
|
-
|
|
54
|
+
large: string;
|
|
51
55
|
medium: string;
|
|
56
|
+
small: string;
|
|
57
|
+
};
|
|
58
|
+
colors: ThemeColors;
|
|
59
|
+
shadows: {
|
|
52
60
|
large: string;
|
|
61
|
+
medium: string;
|
|
62
|
+
small: string;
|
|
63
|
+
};
|
|
64
|
+
spacing: {
|
|
65
|
+
unit: number;
|
|
53
66
|
};
|
|
54
67
|
}
|
|
55
68
|
export interface Theme extends ThemeConfig {
|