@asgardeo/react 0.2.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -6
- package/dist/AsgardeoReactClient.d.ts +38 -0
- package/dist/__temp__/api.d.ts +228 -0
- package/dist/__temp__/models.d.ts +97 -0
- package/dist/api/scim2/getMeProfile.d.ts +39 -0
- package/dist/api/scim2/getSchemas.d.ts +39 -0
- package/dist/api/scim2/updateMeProfile.d.ts +38 -0
- package/dist/cjs/index.js +17998 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +66 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts +65 -0
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +66 -0
- package/dist/components/actions/SignOutButton/SignOutButton.d.ts +65 -0
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +66 -0
- package/dist/components/actions/SignUpButton/SignUpButton.d.ts +66 -0
- package/dist/components/control/SignedIn.d.ts +45 -0
- package/dist/components/control/SignedOut.d.ts +45 -0
- package/dist/components/factories/FieldFactory.d.ts +107 -0
- package/dist/components/presentation/SignIn/BaseSignIn.d.ts +125 -0
- package/dist/components/presentation/SignIn/SignIn.d.ts +62 -0
- package/dist/{esm/types/hooks/use-config.d.ts → components/presentation/SignIn/options/EmailOtp.d.ts} +7 -5
- package/dist/components/presentation/SignIn/options/FacebookButton.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/GitHubButton.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/GoogleButton.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/IdentifierFirst.d.ts +25 -0
- package/dist/components/presentation/SignIn/options/LinkedInButton.d.ts +25 -0
- package/dist/{esm/types/components/SignIn/fragments/SmsOtp.d.ts → components/presentation/SignIn/options/MicrosoftButton.d.ts} +9 -5
- package/dist/components/presentation/SignIn/options/MultiOptionButton.d.ts +26 -0
- package/dist/components/presentation/SignIn/options/SignInOptionFactory.d.ts +76 -0
- package/dist/{esm/types/components/SignOutButton/SignOutButton.d.ts → components/presentation/SignIn/options/SignInWithEthereumButton.d.ts} +7 -9
- package/dist/{esm/types/contexts/branding-preference-context.d.ts → components/presentation/SignIn/options/SmsOtp.d.ts} +9 -5
- package/dist/components/presentation/SignIn/options/SocialButton.d.ts +25 -0
- package/dist/{esm/types/contexts/asgardeo-context.d.ts → components/presentation/SignIn/options/Totp.d.ts} +9 -5
- package/dist/components/presentation/SignIn/options/UsernamePassword.d.ts +25 -0
- package/dist/components/presentation/SignIn/types.d.ts +124 -0
- package/dist/components/presentation/User/BaseUser.d.ts +66 -0
- package/dist/components/presentation/User/User.d.ts +62 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts +76 -0
- package/dist/components/presentation/UserDropdown/UserDropdown.d.ts +49 -0
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +63 -0
- package/dist/components/presentation/UserProfile/UserProfile.d.ts +49 -0
- package/dist/components/primitives/Alert/Alert.d.ts +74 -0
- package/dist/{esm/types/components/SignIn/SignIn.d.ts → components/primitives/Avatar/Avatar.d.ts} +25 -14
- package/dist/components/primitives/Button/Button.d.ts +83 -0
- package/dist/components/primitives/Card/Card.d.ts +133 -0
- package/dist/{esm/types/oxygen-ui-react-auth-components/models/component.d.ts → components/primitives/Checkbox/Checkbox.d.ts} +22 -7
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +50 -0
- package/dist/components/primitives/Divider/Divider.d.ts +58 -0
- package/dist/components/primitives/FormControl/FormControl.d.ts +50 -0
- package/dist/components/primitives/Icons/CircleAlert.d.ts +23 -0
- package/dist/components/primitives/Icons/CircleCheck.d.ts +23 -0
- package/dist/{esm/types/models/use-config.d.ts → components/primitives/Icons/Eye.d.ts} +7 -6
- package/dist/{esm/types/contexts/i18n-context.d.ts → components/primitives/Icons/EyeOff.d.ts} +7 -5
- package/dist/{esm/types/hooks/use-on.d.ts → components/primitives/Icons/Info.d.ts} +7 -4
- package/dist/components/primitives/Icons/TriangleAlert.d.ts +23 -0
- package/dist/components/primitives/InputLabel/InputLabel.d.ts +46 -0
- package/dist/components/primitives/OtpField/OtpField.d.ts +86 -0
- package/dist/{esm/types/components/SignInButton/SignInButton.d.ts → components/primitives/PasswordField/PasswordField.d.ts} +13 -11
- package/dist/components/primitives/Popover/Popover.d.ts +96 -0
- package/dist/components/primitives/Select/Select.d.ts +60 -0
- package/dist/components/primitives/Spinner/Spinner.d.ts +54 -0
- package/dist/components/primitives/TextField/TextField.d.ts +62 -0
- package/dist/components/primitives/Typography/Typography.d.ts +81 -0
- package/dist/contexts/Asgardeo/AsgardeoContext.d.ts +57 -0
- package/dist/{esm/types/components/public-components.d.ts → contexts/Asgardeo/AsgardeoProvider.d.ts} +9 -6
- package/dist/contexts/Asgardeo/useAsgardeo.d.ts +20 -0
- package/dist/contexts/Flow/FlowContext.d.ts +73 -0
- package/dist/contexts/Flow/FlowProvider.d.ts +46 -0
- package/dist/contexts/Flow/useFlow.d.ts +48 -0
- package/dist/contexts/I18n/I18nContext.d.ts +42 -0
- package/dist/{esm/types/components/SignedIn/SignedIn.d.ts → contexts/I18n/I18nProvider.d.ts} +12 -10
- package/dist/contexts/I18n/useI18n.d.ts +27 -0
- package/dist/{esm/types/models/asgardeo-provider-props.d.ts → contexts/Theme/ThemeContext.d.ts} +8 -7
- package/dist/{esm/types/models/branding-preference-provider-props.d.ts → contexts/Theme/ThemeProvider.d.ts} +8 -5
- package/dist/{esm/types/models/use-on.d.ts → contexts/Theme/types.d.ts} +22 -12
- package/dist/{esm/types/models/signed-props.d.ts → contexts/Theme/useTheme.d.ts} +4 -6
- package/dist/contexts/User/UserContext.d.ts +32 -0
- package/dist/contexts/User/UserProvider.d.ts +55 -0
- package/dist/contexts/User/useUser.d.ts +94 -0
- package/dist/hooks/useBrowserUrl.d.ts +47 -0
- package/dist/hooks/useForm.d.ts +192 -0
- package/dist/hooks/useTranslation.d.ts +52 -0
- package/dist/index.d.ts +121 -348
- package/dist/index.js +18064 -0
- package/dist/index.js.map +7 -0
- package/dist/{esm/types/models/public-models.d.ts → models/config.d.ts} +3 -3
- package/dist/utils/getMappedUserProfileValue.d.ts +51 -0
- package/package.json +55 -59
- package/dist/esm/index.js +0 -45278
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/SignIn/fragments/BasicAuth.d.ts +0 -35
- package/dist/esm/types/components/SignIn/fragments/EmailOtp.d.ts +0 -32
- package/dist/esm/types/components/SignIn/fragments/IdentifierFirst.d.ts +0 -35
- package/dist/esm/types/components/SignIn/fragments/LoginOptionsBox.d.ts +0 -30
- package/dist/esm/types/components/SignIn/fragments/Totp.d.ts +0 -33
- package/dist/esm/types/components/SignedOut/SignedOut.d.ts +0 -29
- package/dist/esm/types/hooks/use-authentication.d.ts +0 -27
- package/dist/esm/types/hooks/use-translations.d.ts +0 -33
- package/dist/esm/types/index.d.ts +0 -22
- package/dist/esm/types/models/auth-context.d.ts +0 -43
- package/dist/esm/types/models/basic-auth-props.d.ts +0 -29
- package/dist/esm/types/models/email-otp-props.d.ts +0 -26
- package/dist/esm/types/models/i18n.d.ts +0 -34
- package/dist/esm/types/models/jwt-verify-options.d.ts +0 -25
- package/dist/esm/types/models/login-options-box-props.d.ts +0 -24
- package/dist/esm/types/models/sign-in.d.ts +0 -49
- package/dist/esm/types/models/totp-props.d.ts +0 -26
- package/dist/esm/types/models/use-authentication.d.ts +0 -29
- package/dist/esm/types/models/use-translations.d.ts +0 -22
- package/dist/esm/types/oxygen-ui-react-auth-components/SignIn/SignIn.d.ts +0 -79
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInAlert/SignInAlert.d.ts +0 -37
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInButton/SignInButton.d.ts +0 -27
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInDivider/SignInDivider.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInFooter/SignInFooter.d.ts +0 -29
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInImage/SignInImage.d.ts +0 -23
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInLink/SignInLink.d.ts +0 -25
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInPaper/SignInPaper.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInPinInput/SignInPinInput.d.ts +0 -30
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInTextField/SignInTextField.d.ts +0 -26
- package/dist/esm/types/oxygen-ui-react-auth-components/SignInTypography/SignInTypography.d.ts +0 -32
- package/dist/esm/types/oxygen-ui-react-auth-components/index.d.ts +0 -19
- package/dist/esm/types/providers/AsgardeoProvider.d.ts +0 -34
- package/dist/esm/types/providers/BrandingPreferenceProvider.d.ts +0 -32
- package/dist/esm/types/providers/I18nProvider.d.ts +0 -33
- package/dist/esm/types/theme/generate-theme-sign-in.d.ts +0 -28
- package/dist/esm/types/theme/generate-theme.d.ts +0 -30
- package/dist/esm/types/utils/crypto-utils.d.ts +0 -52
- package/dist/esm/types/utils/session-store.d.ts +0 -25
|
@@ -0,0 +1,125 @@
|
|
|
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
|
+
import { ApplicationNativeAuthenticationInitiateResponse, ApplicationNativeAuthenticationHandleResponse } from '@asgardeo/browser';
|
|
19
|
+
import { FC } from 'react';
|
|
20
|
+
/**
|
|
21
|
+
* Props for the BaseSignIn component.
|
|
22
|
+
*/
|
|
23
|
+
export interface BaseSignInProps {
|
|
24
|
+
/**
|
|
25
|
+
* Function to initialize authentication flow.
|
|
26
|
+
* @returns Promise resolving to the initial authentication response.
|
|
27
|
+
*/
|
|
28
|
+
onInitialize: () => Promise<ApplicationNativeAuthenticationInitiateResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Function to handle authentication steps.
|
|
31
|
+
* @param payload - The authentication payload.
|
|
32
|
+
* @returns Promise resolving to the authentication response.
|
|
33
|
+
*/
|
|
34
|
+
onSubmit: (flow: {
|
|
35
|
+
requestConfig?: {
|
|
36
|
+
method: string;
|
|
37
|
+
url: string;
|
|
38
|
+
};
|
|
39
|
+
payload: {
|
|
40
|
+
flowId: string;
|
|
41
|
+
selectedAuthenticator: {
|
|
42
|
+
authenticatorId: string;
|
|
43
|
+
params: Record<string, string>;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}) => Promise<ApplicationNativeAuthenticationHandleResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Callback function called when authentication is successful.
|
|
49
|
+
* @param authData - The authentication data returned upon successful completion.
|
|
50
|
+
*/
|
|
51
|
+
onSuccess?: (authData: Record<string, any>) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Callback function called when authentication fails.
|
|
54
|
+
* @param error - The error that occurred during authentication.
|
|
55
|
+
*/
|
|
56
|
+
onError?: (error: Error) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Callback function called when authentication flow status changes.
|
|
59
|
+
* @param response - The current authentication response.
|
|
60
|
+
*/
|
|
61
|
+
onFlowChange?: (response: ApplicationNativeAuthenticationInitiateResponse | ApplicationNativeAuthenticationHandleResponse) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Custom CSS class name for the form container.
|
|
64
|
+
*/
|
|
65
|
+
className?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Custom CSS class name for form inputs.
|
|
68
|
+
*/
|
|
69
|
+
inputClassName?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Custom CSS class name for the submit button.
|
|
72
|
+
*/
|
|
73
|
+
buttonClassName?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Custom CSS class name for error messages.
|
|
76
|
+
*/
|
|
77
|
+
errorClassName?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Custom CSS class name for info messages.
|
|
80
|
+
*/
|
|
81
|
+
messageClassName?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Size variant for the component.
|
|
84
|
+
*/
|
|
85
|
+
size?: 'small' | 'medium' | 'large';
|
|
86
|
+
/**
|
|
87
|
+
* Theme variant for the component.
|
|
88
|
+
*/
|
|
89
|
+
variant?: 'default' | 'outlined' | 'filled';
|
|
90
|
+
afterSignInUrl?: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Base SignIn component that provides native authentication flow.
|
|
94
|
+
* This component handles both the presentation layer and authentication flow logic.
|
|
95
|
+
* It accepts API functions as props to maintain framework independence.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```tsx
|
|
99
|
+
* import { BaseSignIn } from '@asgardeo/react';
|
|
100
|
+
*
|
|
101
|
+
* const MySignIn = () => {
|
|
102
|
+
* return (
|
|
103
|
+
* <BaseSignIn
|
|
104
|
+
* onInitialize={async () => {
|
|
105
|
+
* // Your API call to initialize authentication
|
|
106
|
+
* return await initializeAuth();
|
|
107
|
+
* }}
|
|
108
|
+
* onSubmit={async (payload) => {
|
|
109
|
+
* // Your API call to handle authentication
|
|
110
|
+
* return await handleAuth(payload);
|
|
111
|
+
* }}
|
|
112
|
+
* onSuccess={(authData) => {
|
|
113
|
+
* console.log('Success:', authData);
|
|
114
|
+
* }}
|
|
115
|
+
* onError={(error) => {
|
|
116
|
+
* console.error('Error:', error);
|
|
117
|
+
* }}
|
|
118
|
+
* className="max-w-md mx-auto"
|
|
119
|
+
* />
|
|
120
|
+
* );
|
|
121
|
+
* };
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
declare const BaseSignIn: FC<BaseSignInProps>;
|
|
125
|
+
export default BaseSignIn;
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Props for the SignIn component.
|
|
21
|
+
*/
|
|
22
|
+
export interface SignInProps {
|
|
23
|
+
/**
|
|
24
|
+
* Additional CSS class names for customization.
|
|
25
|
+
*/
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Size variant for the component.
|
|
29
|
+
*/
|
|
30
|
+
size?: 'small' | 'medium' | 'large';
|
|
31
|
+
/**
|
|
32
|
+
* Theme variant for the component.
|
|
33
|
+
*/
|
|
34
|
+
variant?: 'default' | 'outlined' | 'filled';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A styled SignIn component that provides native authentication flow with pre-built styling.
|
|
38
|
+
* This component handles the API calls for authentication and delegates UI logic to BaseSignIn.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* import { SignIn } from '@asgardeo/react';
|
|
43
|
+
*
|
|
44
|
+
* const App = () => {
|
|
45
|
+
* return (
|
|
46
|
+
* <SignIn
|
|
47
|
+
* onSuccess={(authData) => {
|
|
48
|
+
* console.log('Authentication successful:', authData);
|
|
49
|
+
* // Handle successful authentication (e.g., redirect, store tokens)
|
|
50
|
+
* }}
|
|
51
|
+
* onError={(error) => {
|
|
52
|
+
* console.error('Authentication failed:', error);
|
|
53
|
+
* }}
|
|
54
|
+
* size="medium"
|
|
55
|
+
* variant="outlined"
|
|
56
|
+
* />
|
|
57
|
+
* );
|
|
58
|
+
* };
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare const SignIn: FC<SignInProps>;
|
|
62
|
+
export default SignIn;
|
|
@@ -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,9 +15,11 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import
|
|
18
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
21
|
+
* Email OTP Sign-In Option Component.
|
|
22
|
+
* Handles email-based OTP authentication.
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
declare const EmailOtp: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default EmailOtp;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* Facebook Sign-In Button Component.
|
|
22
|
+
* Handles authentication with Facebook identity provider.
|
|
23
|
+
*/
|
|
24
|
+
declare const FacebookButton: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default FacebookButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* GitHub Sign-In Button Component.
|
|
22
|
+
* Handles authentication with GitHub identity provider.
|
|
23
|
+
*/
|
|
24
|
+
declare const GitHubButton: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default GitHubButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* Google Sign-In Button Component.
|
|
22
|
+
* Handles authentication with Google identity provider.
|
|
23
|
+
*/
|
|
24
|
+
declare const GoogleButton: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default GoogleButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* Identifier First Sign-In Option Component.
|
|
22
|
+
* Handles identifier-first authentication flow (username first, then password).
|
|
23
|
+
*/
|
|
24
|
+
declare const IdentifierFirst: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default IdentifierFirst;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* LinkedIn Sign-In Button Component.
|
|
22
|
+
* Handles authentication with LinkedIn identity provider.
|
|
23
|
+
*/
|
|
24
|
+
declare const LinkedInButton: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default LinkedInButton;
|
|
@@ -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,7 +15,11 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* Microsoft Sign-In Button Component.
|
|
22
|
+
* Handles authentication with Microsoft identity provider.
|
|
23
|
+
*/
|
|
24
|
+
declare const MicrosoftButton: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default MicrosoftButton;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* Multi Option Button Component.
|
|
22
|
+
* Renders authenticators as selectable buttons for multi-option prompts.
|
|
23
|
+
* Used when authenticators don't require immediate user input but need to be selected first.
|
|
24
|
+
*/
|
|
25
|
+
declare const MultiOptionButton: FC<BaseSignInOptionProps>;
|
|
26
|
+
export default MultiOptionButton;
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
import { ApplicationNativeAuthenticationAuthenticator, WithPreferences } from '@asgardeo/browser';
|
|
19
|
+
import { ReactElement } from 'react';
|
|
20
|
+
/**
|
|
21
|
+
* Base props that all sign-in option components share.
|
|
22
|
+
*/
|
|
23
|
+
export interface BaseSignInOptionProps extends WithPreferences {
|
|
24
|
+
/**
|
|
25
|
+
* The authenticator configuration.
|
|
26
|
+
*/
|
|
27
|
+
authenticator: ApplicationNativeAuthenticationAuthenticator;
|
|
28
|
+
/**
|
|
29
|
+
* Current form values.
|
|
30
|
+
*/
|
|
31
|
+
formValues: Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Touched state for form fields.
|
|
34
|
+
*/
|
|
35
|
+
touchedFields: Record<string, boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the component is in loading state.
|
|
38
|
+
*/
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Error message to display.
|
|
42
|
+
*/
|
|
43
|
+
error?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Callback function called when input values change.
|
|
46
|
+
*/
|
|
47
|
+
onInputChange: (param: string, value: string) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Callback function called when the option is submitted.
|
|
50
|
+
*/
|
|
51
|
+
onSubmit: (authenticator: ApplicationNativeAuthenticationAuthenticator, formData?: Record<string, string>) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Custom CSS class name for form inputs.
|
|
54
|
+
*/
|
|
55
|
+
inputClassName?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Custom CSS class name for the submit button.
|
|
58
|
+
*/
|
|
59
|
+
buttonClassName?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Text for the submit button.
|
|
62
|
+
*/
|
|
63
|
+
submitButtonText?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Creates the appropriate sign-in option component based on the authenticator's ID.
|
|
67
|
+
*/
|
|
68
|
+
export declare const createSignInOption: (props: BaseSignInOptionProps) => ReactElement;
|
|
69
|
+
/**
|
|
70
|
+
* Convenience function that creates the appropriate sign-in option component from an authenticator.
|
|
71
|
+
*/
|
|
72
|
+
export declare const createSignInOptionFromAuthenticator: (authenticator: ApplicationNativeAuthenticationAuthenticator, formValues: Record<string, string>, touchedFields: Record<string, boolean>, isLoading: boolean, onInputChange: (param: string, value: string) => void, onSubmit: (authenticator: ApplicationNativeAuthenticationAuthenticator, formData?: Record<string, string>) => void, options?: {
|
|
73
|
+
inputClassName?: string;
|
|
74
|
+
buttonClassName?: string;
|
|
75
|
+
error?: string | null;
|
|
76
|
+
}) => ReactElement;
|
|
@@ -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,13 +15,11 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
19
20
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* This component renders a sign out button. When clicked, it triggers the sign out process.
|
|
23
|
-
*
|
|
24
|
-
* @returns {ReactElement} Rendered SignOutButton component.
|
|
21
|
+
* Sign In With Ethereum Button Component.
|
|
22
|
+
* Handles authentication with Sign In With Ethereum identity provider.
|
|
25
23
|
*/
|
|
26
|
-
declare const
|
|
27
|
-
export default
|
|
24
|
+
declare const SignInWithEthereumButton: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default SignInWithEthereumButton;
|
|
@@ -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,7 +15,11 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* SMS OTP Sign-In Option Component.
|
|
22
|
+
* Handles SMS-based OTP authentication.
|
|
23
|
+
*/
|
|
24
|
+
declare const SmsOtp: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default SmsOtp;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* Social Login Sign-In Option Component.
|
|
22
|
+
* Handles authentication with external identity providers (Google, GitHub, etc.).
|
|
23
|
+
*/
|
|
24
|
+
declare const SocialLogin: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default SocialLogin;
|
|
@@ -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,7 +15,11 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* TOTP Sign-In Option Component.
|
|
22
|
+
* Handles Time-based One-Time Password (TOTP) authentication.
|
|
23
|
+
*/
|
|
24
|
+
declare const Totp: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default Totp;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { FC } from 'react';
|
|
19
|
+
import { BaseSignInOptionProps } from './SignInOptionFactory';
|
|
20
|
+
/**
|
|
21
|
+
* Username Password Sign-In Option Component.
|
|
22
|
+
* Handles traditional username and password authentication.
|
|
23
|
+
*/
|
|
24
|
+
declare const UsernamePassword: FC<BaseSignInOptionProps>;
|
|
25
|
+
export default UsernamePassword;
|