@asgardeo/javascript 0.0.1 → 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/README.md +3 -3
- package/dist/AsgardeoJavaScriptClient.d.ts +17 -50
- package/dist/IsomorphicCrypto.d.ts +4 -4
- package/dist/{__legacy__/data/data-layer.d.ts → StorageManager.d.ts} +27 -26
- package/dist/__legacy__/client.d.ts +82 -98
- package/dist/__legacy__/helpers/authentication-helper.d.ts +9 -9
- package/dist/__legacy__/models/client-config.d.ts +6 -6
- package/dist/__legacy__/models/index.d.ts +0 -5
- 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/{oidc/getUserInfo.d.ts → getUserInfo.d.ts} +1 -1
- 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 +2437 -1224
- package/dist/cjs/index.js.map +4 -4
- package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts +39 -0
- package/dist/constants/OIDCRequestConstants.d.ts +14 -0
- package/dist/constants/PKCEConstants.d.ts +1 -0
- package/dist/constants/ScopeConstants.d.ts +3 -6
- package/dist/constants/TokenExchangeConstants.d.ts +3 -3
- package/dist/constants/VendorConstants.d.ts +31 -0
- package/dist/{__legacy__/exception → errors}/exception.d.ts +3 -0
- package/dist/{__legacy__/data/index.d.ts → i18n/en-US.d.ts} +4 -2
- package/dist/{__legacy__/exception → i18n}/index.d.ts +2 -2
- package/dist/index.d.ts +44 -11
- package/dist/index.js +2399 -1219
- package/dist/index.js.map +4 -4
- package/dist/models/client.d.ts +60 -5
- package/dist/models/config.d.ts +51 -2
- package/dist/models/crypto.d.ts +2 -2
- package/dist/models/embedded-flow.d.ts +66 -0
- package/dist/models/embedded-signin-flow.d.ts +99 -0
- package/dist/{__legacy__/models/custom-grant.d.ts → models/field.d.ts} +13 -9
- package/dist/models/flow.d.ts +30 -0
- package/dist/models/i18n.d.ts +90 -0
- package/dist/{__legacy__/models/authorization-url.d.ts → models/oauth-request.d.ts} +3 -3
- package/dist/models/oauth-response.d.ts +1 -17
- package/dist/models/organization.d.ts +24 -0
- package/dist/models/scim2-schema.d.ts +3 -0
- package/dist/{__legacy__/models/data.d.ts → models/session.d.ts} +4 -0
- package/dist/models/store.d.ts +1 -1
- package/dist/models/token.d.ts +79 -20
- package/dist/models/user.d.ts +11 -84
- package/dist/theme/createTheme.d.ts +1 -1
- package/dist/theme/types.d.ts +29 -17
- package/dist/utils/deepMerge.d.ts +44 -0
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts +2 -2
- package/dist/utils/extractUserClaimsFromIdToken.d.ts +2 -2
- package/dist/utils/flattenUserSchema.d.ts +64 -0
- package/dist/utils/generateFlattenedUserProfile.d.ts +53 -0
- package/dist/utils/generateUserProfile.d.ts +55 -0
- package/dist/utils/get.d.ts +29 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts +59 -0
- package/dist/utils/getI18nBundles.d.ts +26 -0
- package/dist/utils/getLatestStateParam.d.ts +40 -0
- package/dist/utils/isEmpty.d.ts +48 -0
- package/dist/utils/processOpenIDScopes.d.ts +36 -0
- package/dist/{__legacy__/core/index.d.ts → utils/resolveFieldName.d.ts} +3 -2
- package/dist/utils/resolveFieldType.d.ts +20 -0
- package/dist/utils/set.d.ts +30 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts +32 -0
- package/package.json +4 -4
- package/dist/__legacy__/core/authentication-core.d.ts +0 -51
- package/dist/__legacy__/models/fetch.d.ts +0 -55
- package/dist/__legacy__/models/user.d.ts +0 -85
- package/dist/models/id-token.d.ts +0 -55
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 {
|
|
18
|
+
import { EmbeddedFlowExecuteRequestConfig, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse } from './embedded-flow';
|
|
19
|
+
import { EmbeddedSignInFlowHandleRequestPayload } from './embedded-signin-flow';
|
|
20
|
+
import { Organization } from './organization';
|
|
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,12 +33,37 @@ 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
|
*
|
|
35
58
|
* @returns User object containing user details.
|
|
36
59
|
*/
|
|
37
60
|
getUser(): Promise<User>;
|
|
61
|
+
/**
|
|
62
|
+
* Fetches the user profile along with its schemas and a flattened version of the profile.
|
|
63
|
+
*
|
|
64
|
+
* @returns A promise resolving to a UserProfile object containing the user's profile information.
|
|
65
|
+
*/
|
|
66
|
+
getUserProfile(): Promise<UserProfile>;
|
|
38
67
|
/**
|
|
39
68
|
* Initializes the authentication client with provided configuration.
|
|
40
69
|
*
|
|
@@ -51,7 +80,7 @@ export interface AsgardeoClient<T> {
|
|
|
51
80
|
isLoading(): boolean;
|
|
52
81
|
/**
|
|
53
82
|
* Checks if a user is signed in.
|
|
54
|
-
* FIXME: This should be integrated with the existing
|
|
83
|
+
* FIXME: This should be integrated with the existing isSignedIn method which returns a Promise.
|
|
55
84
|
*
|
|
56
85
|
* @returns Boolean indicating sign-in status.
|
|
57
86
|
*/
|
|
@@ -60,9 +89,21 @@ export interface AsgardeoClient<T> {
|
|
|
60
89
|
* Initiates the sign-in process for the user.
|
|
61
90
|
*
|
|
62
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.
|
|
63
94
|
* @returns Promise resolving the user upon successful sign in.
|
|
64
95
|
*/
|
|
65
|
-
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>;
|
|
66
107
|
/**
|
|
67
108
|
* Signs out the currently signed-in user.
|
|
68
109
|
*
|
|
@@ -70,7 +111,7 @@ export interface AsgardeoClient<T> {
|
|
|
70
111
|
* @param afterSignOut - Callback function to be executed after sign-out is complete.
|
|
71
112
|
* @returns A promise that resolves to true if sign-out is successful
|
|
72
113
|
*/
|
|
73
|
-
signOut(options?: SignOutOptions, afterSignOut?: (
|
|
114
|
+
signOut(options?: SignOutOptions, afterSignOut?: (afterSignOutUrl: string) => void): Promise<string>;
|
|
74
115
|
/**
|
|
75
116
|
* Signs out the currently signed-in user with an optional session ID.
|
|
76
117
|
*
|
|
@@ -80,5 +121,19 @@ export interface AsgardeoClient<T> {
|
|
|
80
121
|
* @param afterSignOut - Callback function to be executed after sign-out is complete.
|
|
81
122
|
* @returns A promise that resolves to true if sign-out is successful
|
|
82
123
|
*/
|
|
83
|
-
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>;
|
|
84
139
|
}
|
package/dist/models/config.d.ts
CHANGED
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { I18nBundle } from './i18n';
|
|
19
19
|
import { RecursivePartial } from './utility-types';
|
|
20
|
-
|
|
20
|
+
import { ThemeConfig, ThemeMode } from '../theme/types';
|
|
21
|
+
export interface BaseConfig<T = unknown> extends WithPreferences {
|
|
21
22
|
/**
|
|
22
23
|
* Optional URL where the authorization server should redirect after authentication.
|
|
23
24
|
* This must match one of the allowed redirect URIs configured in your IdP.
|
|
@@ -28,6 +29,17 @@ export interface BaseConfig<T = unknown> {
|
|
|
28
29
|
* For production: "https://your-app.com/api/auth/callback"
|
|
29
30
|
*/
|
|
30
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;
|
|
31
43
|
/**
|
|
32
44
|
* The base URL of the Asgardeo identity server.
|
|
33
45
|
* Example: "https://api.asgardeo.io/t/{org_name}"
|
|
@@ -57,6 +69,21 @@ export interface BaseConfig<T = unknown> {
|
|
|
57
69
|
* scopes: ["openid", "profile", "email"]
|
|
58
70
|
*/
|
|
59
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;
|
|
85
|
+
}
|
|
86
|
+
export interface WithPreferences {
|
|
60
87
|
/**
|
|
61
88
|
* Preferences for customizing the Asgardeo UI components
|
|
62
89
|
*/
|
|
@@ -73,7 +100,29 @@ export interface ThemePreferences {
|
|
|
73
100
|
*/
|
|
74
101
|
overrides?: RecursivePartial<ThemeConfig>;
|
|
75
102
|
}
|
|
103
|
+
export interface I18nPreferences {
|
|
104
|
+
/**
|
|
105
|
+
* Custom translations to override default ones.
|
|
106
|
+
*/
|
|
107
|
+
bundles?: {
|
|
108
|
+
[key: string]: I18nBundle;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* The fallback language to use if translations are not available in the specified language.
|
|
112
|
+
* Defaults to 'en-US'.
|
|
113
|
+
*/
|
|
114
|
+
fallbackLanguage?: string;
|
|
115
|
+
/**
|
|
116
|
+
* The language to use for translations.
|
|
117
|
+
* Defaults to the browser's default language.
|
|
118
|
+
*/
|
|
119
|
+
language?: string;
|
|
120
|
+
}
|
|
76
121
|
export interface Preferences {
|
|
122
|
+
/**
|
|
123
|
+
* Internationalization preferences for the Asgardeo UI components
|
|
124
|
+
*/
|
|
125
|
+
i18n?: I18nPreferences;
|
|
77
126
|
/**
|
|
78
127
|
* Theme preferences for the Asgardeo UI components
|
|
79
128
|
*/
|
package/dist/models/crypto.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export interface Crypto<T = any> {
|
|
|
87
87
|
* @param idToken - ID Token to be verified.
|
|
88
88
|
* @param jwk - JWK to be used for verification.
|
|
89
89
|
* @param algorithms - Algorithms to be used for verification.
|
|
90
|
-
* @param
|
|
90
|
+
* @param clientId - Client ID to be used for verification.
|
|
91
91
|
* @param issuer - Issuer to be used for verification.
|
|
92
92
|
* @param subject - Subject to be used for verification.
|
|
93
93
|
* @param clockTolerance - Clock tolerance to be used for verification.
|
|
@@ -96,5 +96,5 @@ export interface Crypto<T = any> {
|
|
|
96
96
|
*
|
|
97
97
|
* @throws if the id_token is invalid.
|
|
98
98
|
*/
|
|
99
|
-
verifyJwt(idToken: string, jwk: JWKInterface, algorithms: string[],
|
|
99
|
+
verifyJwt(idToken: string, jwk: JWKInterface, algorithms: string[], clientId: string, issuer: string, subject: string, clockTolerance?: number, validateJwtIssuer?: boolean): Promise<boolean>;
|
|
100
100
|
}
|
|
@@ -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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
3
|
*
|
|
4
4
|
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
5
|
* Version 2.0 (the "License"); you may not use this file except
|
|
@@ -15,12 +15,16 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
export declare enum FieldType {
|
|
19
|
+
Text = "TEXT",
|
|
20
|
+
Password = "PASSWORD",
|
|
21
|
+
Email = "EMAIL",
|
|
22
|
+
Number = "NUMBER",
|
|
23
|
+
Select = "SELECT",
|
|
24
|
+
Checkbox = "CHECKBOX",
|
|
25
|
+
Radio = "RADIO",
|
|
26
|
+
Otp = "OTP",
|
|
27
|
+
Date = "DATE",
|
|
28
|
+
Time = "TIME",
|
|
29
|
+
Textarea = "TEXTAREA"
|
|
26
30
|
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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 I18nTranslations {
|
|
19
|
+
'elements.buttons.signIn': string;
|
|
20
|
+
'elements.buttons.signOut': string;
|
|
21
|
+
'elements.buttons.signUp': string;
|
|
22
|
+
'elements.buttons.facebook': string;
|
|
23
|
+
'elements.buttons.google': string;
|
|
24
|
+
'elements.buttons.github': string;
|
|
25
|
+
'elements.buttons.microsoft': string;
|
|
26
|
+
'elements.buttons.linkedin': string;
|
|
27
|
+
'elements.buttons.ethereum': string;
|
|
28
|
+
'elements.buttons.multi.option': string;
|
|
29
|
+
'elements.buttons.social': string;
|
|
30
|
+
'elements.fields.placeholder': string;
|
|
31
|
+
'signin.title': string;
|
|
32
|
+
'signin.subtitle': string;
|
|
33
|
+
'signup.title': string;
|
|
34
|
+
'signup.subtitle': string;
|
|
35
|
+
'email.otp.title': string;
|
|
36
|
+
'email.otp.subtitle': string;
|
|
37
|
+
'email.otp.submit.button': string;
|
|
38
|
+
'identifier.first.title': string;
|
|
39
|
+
'identifier.first.subtitle': string;
|
|
40
|
+
'identifier.first.submit.button': string;
|
|
41
|
+
'sms.otp.title': string;
|
|
42
|
+
'sms.otp.subtitle': string;
|
|
43
|
+
'sms.otp.submit.button': string;
|
|
44
|
+
'totp.title': string;
|
|
45
|
+
'totp.subtitle': string;
|
|
46
|
+
'totp.submit.button': string;
|
|
47
|
+
'username.password.submit.button': string;
|
|
48
|
+
'username.password.title': string;
|
|
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;
|
|
71
|
+
'messages.loading': string;
|
|
72
|
+
'errors.title': string;
|
|
73
|
+
'errors.sign.in.initialization': string;
|
|
74
|
+
'errors.sign.in.flow.failure': string;
|
|
75
|
+
'errors.sign.in.flow.completion.failure': string;
|
|
76
|
+
'errors.sign.in.flow.passkeys.failure': string;
|
|
77
|
+
'errors.sign.in.flow.passkeys.completion.failure': string;
|
|
78
|
+
}
|
|
79
|
+
export type I18nTextDirection = 'ltr' | 'rtl';
|
|
80
|
+
export interface I18nMetadata {
|
|
81
|
+
localeCode: string;
|
|
82
|
+
countryCode: string;
|
|
83
|
+
languageCode: string;
|
|
84
|
+
displayName: string;
|
|
85
|
+
direction: I18nTextDirection;
|
|
86
|
+
}
|
|
87
|
+
export interface I18nBundle {
|
|
88
|
+
metadata: I18nMetadata;
|
|
89
|
+
translations: I18nTranslations;
|
|
90
|
+
}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
export type
|
|
19
|
-
export interface
|
|
18
|
+
export type AuthorizeRequestUrlParams = Omit<ExtendedAuthorizeRequestUrlParams, 'forceInit'>;
|
|
19
|
+
export interface KnownExtendedAuthorizeRequestUrlParams {
|
|
20
20
|
fidp?: string;
|
|
21
21
|
forceInit?: boolean;
|
|
22
22
|
}
|
|
23
|
-
export type
|
|
23
|
+
export type ExtendedAuthorizeRequestUrlParams = KnownExtendedAuthorizeRequestUrlParams & Record<string, string | boolean>;
|
|
@@ -15,20 +15,4 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
* Enum representing different OAuth response modes.
|
|
20
|
-
*/
|
|
21
|
-
export declare enum ResponseMode {
|
|
22
|
-
/**
|
|
23
|
-
* Response is returned as POST parameters in an HTML form.
|
|
24
|
-
*/
|
|
25
|
-
FormPost = "form_post",
|
|
26
|
-
/**
|
|
27
|
-
* Response is returned as query parameters in the URL.
|
|
28
|
-
*/
|
|
29
|
-
Query = "query",
|
|
30
|
-
/**
|
|
31
|
-
* Response is returned directly to the client.
|
|
32
|
-
*/
|
|
33
|
-
Direct = "direct"
|
|
34
|
-
}
|
|
18
|
+
export type OAuthResponseMode = 'form_post' | 'query' | 'direct';
|
|
@@ -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/store.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { OIDCEndpoints } from './oidc-endpoints';
|
|
|
21
21
|
* Implementations can include various storage backends like browser storage,
|
|
22
22
|
* memory cache, or distributed caches like Redis or Memcached.
|
|
23
23
|
*/
|
|
24
|
-
export interface
|
|
24
|
+
export interface Storage {
|
|
25
25
|
/**
|
|
26
26
|
* Stores a value with the specified key.
|
|
27
27
|
*
|