@asgardeo/javascript 0.1.0 → 0.1.2
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 +19 -52
- 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/getBrandingPreference.d.ts +103 -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 +1100 -157
- 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 +24 -6
- package/dist/index.js +1071 -148
- package/dist/index.js.map +4 -4
- package/dist/models/branding-preference.d.ts +248 -0
- package/dist/models/client.d.ts +55 -5
- package/dist/models/config.d.ts +54 -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 +42 -17
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts +47 -0
- 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
|
@@ -0,0 +1,248 @@
|
|
|
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
|
+
/**
|
|
19
|
+
* Interface for color configuration with multiple variants.
|
|
20
|
+
*/
|
|
21
|
+
export interface ColorVariants {
|
|
22
|
+
contrastText?: string;
|
|
23
|
+
dark?: string;
|
|
24
|
+
inverted?: string;
|
|
25
|
+
light?: string;
|
|
26
|
+
main?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Interface for text color configuration.
|
|
30
|
+
*/
|
|
31
|
+
export interface TextColors {
|
|
32
|
+
primary?: string;
|
|
33
|
+
secondary?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Interface for button styling configuration.
|
|
37
|
+
*/
|
|
38
|
+
export interface ButtonStyle {
|
|
39
|
+
base?: {
|
|
40
|
+
background?: {
|
|
41
|
+
backgroundColor?: string;
|
|
42
|
+
};
|
|
43
|
+
border?: {
|
|
44
|
+
borderColor?: string;
|
|
45
|
+
borderRadius?: string;
|
|
46
|
+
};
|
|
47
|
+
font?: {
|
|
48
|
+
color?: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Interface for buttons configuration.
|
|
54
|
+
*/
|
|
55
|
+
export interface ButtonsConfig {
|
|
56
|
+
externalConnection?: ButtonStyle;
|
|
57
|
+
primary?: ButtonStyle;
|
|
58
|
+
secondary?: ButtonStyle;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Interface for color palette configuration.
|
|
62
|
+
*/
|
|
63
|
+
export interface ColorsConfig {
|
|
64
|
+
alerts?: {
|
|
65
|
+
error?: ColorVariants;
|
|
66
|
+
info?: ColorVariants;
|
|
67
|
+
neutral?: ColorVariants;
|
|
68
|
+
warning?: ColorVariants;
|
|
69
|
+
};
|
|
70
|
+
background?: {
|
|
71
|
+
body?: ColorVariants;
|
|
72
|
+
surface?: ColorVariants;
|
|
73
|
+
};
|
|
74
|
+
illustrations?: {
|
|
75
|
+
accent1?: ColorVariants;
|
|
76
|
+
accent2?: ColorVariants;
|
|
77
|
+
accent3?: ColorVariants;
|
|
78
|
+
primary?: ColorVariants;
|
|
79
|
+
secondary?: ColorVariants;
|
|
80
|
+
};
|
|
81
|
+
outlined?: {
|
|
82
|
+
default?: string;
|
|
83
|
+
};
|
|
84
|
+
primary?: ColorVariants;
|
|
85
|
+
secondary?: ColorVariants;
|
|
86
|
+
text?: TextColors;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Interface for footer configuration.
|
|
90
|
+
*/
|
|
91
|
+
export interface FooterConfig {
|
|
92
|
+
border?: {
|
|
93
|
+
borderColor?: string;
|
|
94
|
+
};
|
|
95
|
+
font?: {
|
|
96
|
+
color?: string;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Interface for image configuration.
|
|
101
|
+
*/
|
|
102
|
+
export interface ImageConfig {
|
|
103
|
+
altText?: string;
|
|
104
|
+
imgURL?: string;
|
|
105
|
+
title?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Interface for images configuration.
|
|
109
|
+
*/
|
|
110
|
+
export interface ImagesConfig {
|
|
111
|
+
favicon?: Partial<ImageConfig>;
|
|
112
|
+
logo?: Partial<ImageConfig>;
|
|
113
|
+
myAccountLogo?: Partial<ImageConfig>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Interface for input styling configuration.
|
|
117
|
+
*/
|
|
118
|
+
export interface InputsConfig {
|
|
119
|
+
base?: {
|
|
120
|
+
background?: {
|
|
121
|
+
backgroundColor?: string;
|
|
122
|
+
};
|
|
123
|
+
border?: {
|
|
124
|
+
borderColor?: string;
|
|
125
|
+
borderRadius?: string;
|
|
126
|
+
};
|
|
127
|
+
font?: {
|
|
128
|
+
color?: string;
|
|
129
|
+
};
|
|
130
|
+
labels?: {
|
|
131
|
+
font?: {
|
|
132
|
+
color?: string;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Interface for login box configuration.
|
|
139
|
+
*/
|
|
140
|
+
export interface LoginBoxConfig {
|
|
141
|
+
background?: {
|
|
142
|
+
backgroundColor?: string;
|
|
143
|
+
};
|
|
144
|
+
border?: {
|
|
145
|
+
borderColor?: string;
|
|
146
|
+
borderRadius?: string;
|
|
147
|
+
borderWidth?: string;
|
|
148
|
+
};
|
|
149
|
+
font?: {
|
|
150
|
+
color?: string;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Interface for login page configuration.
|
|
155
|
+
*/
|
|
156
|
+
export interface LoginPageConfig {
|
|
157
|
+
background?: {
|
|
158
|
+
backgroundColor?: string;
|
|
159
|
+
};
|
|
160
|
+
font?: {
|
|
161
|
+
color?: string;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Interface for typography configuration.
|
|
166
|
+
*/
|
|
167
|
+
export interface TypographyConfig {
|
|
168
|
+
font?: {
|
|
169
|
+
color?: string;
|
|
170
|
+
fontFamily?: string;
|
|
171
|
+
importURL?: string;
|
|
172
|
+
};
|
|
173
|
+
heading?: {
|
|
174
|
+
font?: {
|
|
175
|
+
color?: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Interface for theme variant configuration (LIGHT/DARK).
|
|
181
|
+
*/
|
|
182
|
+
export interface ThemeVariant {
|
|
183
|
+
buttons?: ButtonsConfig;
|
|
184
|
+
colors?: ColorsConfig;
|
|
185
|
+
footer?: FooterConfig;
|
|
186
|
+
images?: ImagesConfig;
|
|
187
|
+
inputs?: InputsConfig;
|
|
188
|
+
loginBox?: LoginBoxConfig;
|
|
189
|
+
loginPage?: LoginPageConfig;
|
|
190
|
+
typography?: TypographyConfig;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Interface for branding preference layout configuration.
|
|
194
|
+
*/
|
|
195
|
+
export interface BrandingLayout {
|
|
196
|
+
activeLayout?: string;
|
|
197
|
+
sideImg?: {
|
|
198
|
+
altText?: string;
|
|
199
|
+
imgURL?: string;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Interface for organization details configuration.
|
|
204
|
+
*/
|
|
205
|
+
export interface BrandingOrganizationDetails {
|
|
206
|
+
displayName?: string;
|
|
207
|
+
supportEmail?: string;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Interface for URL configurations.
|
|
211
|
+
*/
|
|
212
|
+
export interface UrlsConfig {
|
|
213
|
+
cookiePolicyURL?: string;
|
|
214
|
+
privacyPolicyURL?: string;
|
|
215
|
+
termsOfUseURL?: string;
|
|
216
|
+
selfSignUpURL?: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Interface for branding preference theme configuration.
|
|
220
|
+
*/
|
|
221
|
+
export interface BrandingTheme {
|
|
222
|
+
activeTheme?: string;
|
|
223
|
+
LIGHT?: ThemeVariant;
|
|
224
|
+
DARK?: ThemeVariant;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Interface for branding preference configuration.
|
|
228
|
+
*/
|
|
229
|
+
export interface BrandingPreferenceConfig {
|
|
230
|
+
configs?: {
|
|
231
|
+
isBrandingEnabled?: boolean;
|
|
232
|
+
removeDefaultBranding?: boolean;
|
|
233
|
+
selfSignUpEnabled?: boolean;
|
|
234
|
+
};
|
|
235
|
+
layout?: BrandingLayout;
|
|
236
|
+
organizationDetails?: BrandingOrganizationDetails;
|
|
237
|
+
theme?: BrandingTheme;
|
|
238
|
+
urls?: UrlsConfig;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Interface for branding preference configuration.
|
|
242
|
+
*/
|
|
243
|
+
export interface BrandingPreference {
|
|
244
|
+
type?: string;
|
|
245
|
+
name?: string;
|
|
246
|
+
locale?: string;
|
|
247
|
+
preference?: BrandingPreferenceConfig;
|
|
248
|
+
}
|
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,18 +33,38 @@ 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(options?: any): Promise<Organization[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the current organization of the user.
|
|
44
|
+
*
|
|
45
|
+
* @returns The current organization if available, otherwise null.
|
|
46
|
+
*/
|
|
47
|
+
getCurrentOrganization(sessionId?: string): 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;
|
|
55
|
+
updateUserProfile(payload: any, userId?: string): Promise<User>;
|
|
32
56
|
/**
|
|
33
57
|
* Gets user information from the session.
|
|
34
58
|
*
|
|
35
59
|
* @returns User object containing user details.
|
|
36
60
|
*/
|
|
37
|
-
getUser(): Promise<User>;
|
|
61
|
+
getUser(options?: any): Promise<User>;
|
|
38
62
|
/**
|
|
39
63
|
* Fetches the user profile along with its schemas and a flattened version of the profile.
|
|
40
64
|
*
|
|
41
65
|
* @returns A promise resolving to a UserProfile object containing the user's profile information.
|
|
42
66
|
*/
|
|
43
|
-
getUserProfile(): Promise<UserProfile>;
|
|
67
|
+
getUserProfile(options?: any): Promise<UserProfile>;
|
|
44
68
|
/**
|
|
45
69
|
* Initializes the authentication client with provided configuration.
|
|
46
70
|
*
|
|
@@ -66,9 +90,21 @@ export interface AsgardeoClient<T> {
|
|
|
66
90
|
* Initiates the sign-in process for the user.
|
|
67
91
|
*
|
|
68
92
|
* @param options - Optional sign-in options like additional parameters to be sent in the authorize request, etc.
|
|
93
|
+
* @param sessionId - Optional session ID to be used for sign-in.
|
|
94
|
+
* @param onSignInSuccess - Callback function to be executed upon successful sign-in.
|
|
69
95
|
* @returns Promise resolving the user upon successful sign in.
|
|
70
96
|
*/
|
|
71
|
-
signIn(options?: SignInOptions): Promise<User>;
|
|
97
|
+
signIn(options?: SignInOptions, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
98
|
+
/**
|
|
99
|
+
* Initiates an embedded (App-Native) sign-in flow for the user.
|
|
100
|
+
*
|
|
101
|
+
* @param payload - The payload containing the necessary information to execute the embedded sign-in flow.
|
|
102
|
+
* @param request - The request object containing URL and parameters for the sign-in flow HTTP request.
|
|
103
|
+
* @param sessionId - Optional session ID to be used for sign-in.
|
|
104
|
+
* @param onSignInSuccess - Callback function to be executed upon successful sign-in.
|
|
105
|
+
* @returns A promise that resolves to an EmbeddedFlowExecuteResponse containing the flow execution details.
|
|
106
|
+
*/
|
|
107
|
+
signIn(payload: EmbeddedSignInFlowHandleRequestPayload, request: EmbeddedFlowExecuteRequestConfig<EmbeddedSignInFlowHandleRequestPayload>, sessionId?: string, onSignInSuccess?: (afterSignInUrl: string) => void): Promise<User>;
|
|
72
108
|
/**
|
|
73
109
|
* Signs out the currently signed-in user.
|
|
74
110
|
*
|
|
@@ -76,7 +112,7 @@ export interface AsgardeoClient<T> {
|
|
|
76
112
|
* @param afterSignOut - Callback function to be executed after sign-out is complete.
|
|
77
113
|
* @returns A promise that resolves to true if sign-out is successful
|
|
78
114
|
*/
|
|
79
|
-
signOut(options?: SignOutOptions, afterSignOut?: (
|
|
115
|
+
signOut(options?: SignOutOptions, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;
|
|
80
116
|
/**
|
|
81
117
|
* Signs out the currently signed-in user with an optional session ID.
|
|
82
118
|
*
|
|
@@ -86,5 +122,19 @@ export interface AsgardeoClient<T> {
|
|
|
86
122
|
* @param afterSignOut - Callback function to be executed after sign-out is complete.
|
|
87
123
|
* @returns A promise that resolves to true if sign-out is successful
|
|
88
124
|
*/
|
|
89
|
-
signOut(options?: SignOutOptions, sessionId?: string, afterSignOut?: (
|
|
125
|
+
signOut(options?: SignOutOptions, sessionId?: string, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;
|
|
126
|
+
/**
|
|
127
|
+
* Initiates a redirection-based sign-up process for the user.
|
|
128
|
+
*
|
|
129
|
+
* @param options - Optional sign-up options like additional parameters to be sent in the sign-up request, etc.
|
|
130
|
+
* @returns Promise resolving to the user upon successful sign up.
|
|
131
|
+
*/
|
|
132
|
+
signUp(options?: SignUpOptions): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Initiates an embedded (App-Native) sign-up flow for the user.
|
|
135
|
+
*
|
|
136
|
+
* @param payload - The payload containing the necessary information to execute the embedded sign-up flow.
|
|
137
|
+
* @returns A promise that resolves to an EmbeddedFlowExecuteResponse containing the flow execution details.
|
|
138
|
+
*/
|
|
139
|
+
signUp(payload: EmbeddedFlowExecuteRequestPayload): Promise<EmbeddedFlowExecuteResponse>;
|
|
90
140
|
}
|
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,31 @@ 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;
|
|
43
|
+
/**
|
|
44
|
+
* Optional organization handle for the Organization in Asgardeo.
|
|
45
|
+
* This is used to identify the organization in the Asgardeo identity server in cases like Branding, etc.
|
|
46
|
+
* If not provided, the framework layer will try to use the `baseUrl` to determine the organization handle.
|
|
47
|
+
* @remarks This is mandatory if a custom domain is configured for the Asgardeo organization.
|
|
48
|
+
*/
|
|
49
|
+
organizationHandle?: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Optional UUID of the Asgardeo application.
|
|
52
|
+
* This is used to identify the application in the Asgardeo identity server for Application Branding,
|
|
53
|
+
* obtaining the access URL in the sign-up flow, etc.
|
|
54
|
+
* If not provided, the framework layer will use the default application ID based on the application.
|
|
55
|
+
*/
|
|
56
|
+
applicationId?: string | undefined;
|
|
32
57
|
/**
|
|
33
58
|
* The base URL of the Asgardeo identity server.
|
|
34
59
|
* Example: "https://api.asgardeo.io/t/{org_name}"
|
|
@@ -58,6 +83,19 @@ export interface BaseConfig<T = unknown> extends WithPreferences {
|
|
|
58
83
|
* scopes: ["openid", "profile", "email"]
|
|
59
84
|
*/
|
|
60
85
|
scopes?: string | string[] | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Optional URL to redirect the user to sign-in.
|
|
88
|
+
* By default, this will be the sign-in page of Asgardeo.
|
|
89
|
+
* If you want to use a custom sign-in page, you can provide the URL here and use the `SignIn` component to render it.
|
|
90
|
+
*/
|
|
91
|
+
signInUrl?: string | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Optional URL to redirect the user to sign-up.
|
|
94
|
+
* By default, this will be the sign-up page of Asgardeo.
|
|
95
|
+
* If you want to use a custom sign-up page, you can provide the URL here
|
|
96
|
+
* and use the `SignUp` component to render it.
|
|
97
|
+
*/
|
|
98
|
+
signUpUrl?: string | undefined;
|
|
61
99
|
}
|
|
62
100
|
export interface WithPreferences {
|
|
63
101
|
/**
|
|
@@ -67,6 +105,10 @@ export interface WithPreferences {
|
|
|
67
105
|
}
|
|
68
106
|
export type Config<T = unknown> = BaseConfig<T>;
|
|
69
107
|
export interface ThemePreferences {
|
|
108
|
+
/**
|
|
109
|
+
* Inherit from Branding from WSO2 Identity Server or Asgardeo.
|
|
110
|
+
*/
|
|
111
|
+
inheritFromBranding?: boolean;
|
|
70
112
|
/**
|
|
71
113
|
* The theme mode to use. Defaults to 'system'.
|
|
72
114
|
*/
|
|
@@ -78,29 +120,29 @@ export interface ThemePreferences {
|
|
|
78
120
|
}
|
|
79
121
|
export interface I18nPreferences {
|
|
80
122
|
/**
|
|
81
|
-
*
|
|
82
|
-
* Defaults to the browser's default language.
|
|
123
|
+
* Custom translations to override default ones.
|
|
83
124
|
*/
|
|
84
|
-
|
|
125
|
+
bundles?: {
|
|
126
|
+
[key: string]: I18nBundle;
|
|
127
|
+
};
|
|
85
128
|
/**
|
|
86
129
|
* The fallback language to use if translations are not available in the specified language.
|
|
87
130
|
* Defaults to 'en-US'.
|
|
88
131
|
*/
|
|
89
132
|
fallbackLanguage?: string;
|
|
90
133
|
/**
|
|
91
|
-
*
|
|
134
|
+
* The language to use for translations.
|
|
135
|
+
* Defaults to the browser's default language.
|
|
92
136
|
*/
|
|
93
|
-
|
|
94
|
-
[key: string]: I18nBundle;
|
|
95
|
-
};
|
|
137
|
+
language?: string;
|
|
96
138
|
}
|
|
97
139
|
export interface Preferences {
|
|
98
|
-
/**
|
|
99
|
-
* Theme preferences for the Asgardeo UI components
|
|
100
|
-
*/
|
|
101
|
-
theme?: ThemePreferences;
|
|
102
140
|
/**
|
|
103
141
|
* Internationalization preferences for the Asgardeo UI components
|
|
104
142
|
*/
|
|
105
143
|
i18n?: I18nPreferences;
|
|
144
|
+
/**
|
|
145
|
+
* Theme preferences for the Asgardeo UI components
|
|
146
|
+
*/
|
|
147
|
+
theme?: ThemePreferences;
|
|
106
148
|
}
|
|
@@ -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;
|