diff --git a/features/admin.connections.v1/components/create/custom-authentication-create-wizard.scss b/features/admin.connections.v1/components/create/custom-authentication-create-wizard.scss index a84edf931a6..e1bd05343cf 100644 --- a/features/admin.connections.v1/components/create/custom-authentication-create-wizard.scss +++ b/features/admin.connections.v1/components/create/custom-authentication-create-wizard.scss @@ -111,7 +111,7 @@ font-weight: bold; margin: 20px; } - .p { + .examples { display: flex; flex-direction: column; justify-content: space-between; diff --git a/features/admin.connections.v1/components/create/custom-authentication-create-wizard.tsx b/features/admin.connections.v1/components/create/custom-authentication-create-wizard.tsx index 351cf55964b..b1b3abcaadd 100644 --- a/features/admin.connections.v1/components/create/custom-authentication-create-wizard.tsx +++ b/features/admin.connections.v1/components/create/custom-authentication-create-wizard.tsx @@ -181,17 +181,17 @@ export const CustomAuthenticationCreateWizard: FC setAlert(undefined), 8000); @@ -349,8 +350,10 @@ export const CustomAuthenticationCreateWizard: FC setIsShowSecret1(!isShowSecret1)) } } - label={ "Access token" } - placeholder={ "Access Token" } + label={ t("customAuthentication:fields.createWizard.configurationsStep." + + "authenticationTypeDropdown.authProperties.accessToken.label") } + placeholder={ t("customAuthentication:fields.createWizard.configurationsStep." + + "authenticationTypeDropdown.authProperties.accessToken.placeholder") } required={ true } maxLength={ 100 } minLength={ 0 } @@ -418,8 +425,10 @@ export const CustomAuthenticationCreateWizard: FC Hint @@ -442,8 +451,10 @@ export const CustomAuthenticationCreateWizard: FC setIsShowSecret2(!isShowSecret2)) } } - label={ "Value" } - placeholder={ "Value" } + label={ t("customAuthentication:fields.createWizard.configurationsStep." + + "authenticationTypeDropdown.authProperties.value.label") } + placeholder={ t("customAuthentication:fields.createWizard.configurationsStep." + + "authenticationTypeDropdown.authProperties.value.placeholder") } required={ true } maxLength={ 100 } minLength={ 0 } @@ -461,18 +472,22 @@ export const CustomAuthenticationCreateWizard: FC => { const error: Partial = {}; if (!values?.endpointUri) { - error.endpointUri = "Empty endpoint URI"; + error.endpointUri = t("customAuthentication:fields.createWizard.configurationsStep." + + "endpoint.validations.empty"); } if (URLUtils.isURLValid(values?.endpointUri)) { if (!(URLUtils.isHttpsUrl(values?.endpointUri))) { - error.endpointUri = "The entered URL is not HTTPS. Please add a valid URL."; + error.endpointUri = t("customAuthentication:fields.createWizard.configurationsStep." + + "endpoint.validations.invalid"); } } else { - error.endpointUri = "Please enter a valid URL."; + error.endpointUri = t("customAuthentication:fields.createWizard.configurationsStep." + + "endpoint.validations.general"); } if (!authenticationType) { - error.authenticationType = "Endpoint is a required field."; + error.authenticationType = t("customAuthentication:fields.createWizard.configurationsStep." + + "authenticationTypeDropdown.validations.required"); } const apiKeyHeaderRegex: RegExp = /^[a-zA-Z0-9][a-zA-Z0-9-.]+$/; @@ -481,31 +496,36 @@ export const CustomAuthenticationCreateWizard: FC
- +
- External (Federated) User Authentication + { t("customAuthentication:fields.createWizard.authenticationTypeStep." + + "externalAuthenticationCard.header") }
) } description={ (
-

Authenticate and provision federated users.

-

Eg: Social Login, Enterprise IdP

+

{ t("customAuthentication:fields.createWizard." + + "authenticationTypeStep.externalAuthenticationCard.mainDescription") }

+

{ t("customAuthentication:fields.createWizard." + + "authenticationTypeStep.externalAuthenticationCard.examples") }

) } contentTopBorder={ false } @@ -568,14 +591,15 @@ export const CustomAuthenticationCreateWizard: FC - Internal User Authentication + { t("customAuthentication:fields.createWizard.authenticationTypeStep." + + "internalUserAuthenticationCard.header") }
) } description={ (
-

- Collect identifier and authenticate user accounts managed in the organization. -

-

Eg: Username & Password, Email OTP

+

{ t("customAuthentication:fields.createWizard." + + "authenticationTypeStep.internalUserAuthenticationCard.mainDescription") }

+

{ t("customAuthentication:fields.createWizard." + + "authenticationTypeStep.internalUserAuthenticationCard.examples") }

) } selected={ selectedAuthenticator === "internal" } @@ -596,14 +620,15 @@ export const CustomAuthenticationCreateWizard: FC - 2FA Authentication + { t("customAuthentication:fields.createWizard.authenticationTypeStep." + + "twoFactorAuthenticationCard.header") } ) } description={ (
-

- Only verify users in a second or later step in the login flow. -

-

Eg: TOTP

+

{ t("customAuthentication:fields.createWizard." + + "authenticationTypeStep.twoFactorAuthenticationCard.mainDescription") }

+

{ t("customAuthentication:fields.createWizard." + + "authenticationTypeStep.twoFactorAuthenticationCard.examples") }

) } selected={ selectedAuthenticator === "two-factor" } @@ -628,11 +653,12 @@ export const CustomAuthenticationCreateWizard: FC ( => { return [ wizardCommonFirstPage(), @@ -741,7 +770,6 @@ export const CustomAuthenticationCreateWizard: FC { return (
- Identifier + { t("customAuthentication:fields.createWizard.helpPanel." + + "hint.header") }

- We recommend using a URI as the identifier, but you do not need to make the URI - publicly available since WSO2 Identity Server will not access your API. - WSO2 Identity Server will use this identifier value as the audience(aud) - claim in the issued JWT tokens. - This field should be unique; once created, it is not editable. + { t("customAuthentication:fields.createWizard.helpPanel.hint.description") } + + { t("customAuthentication:fields.createWizard.helpPanel.hint.warning") } +

); diff --git a/features/admin.core.v1/configs/app.ts b/features/admin.core.v1/configs/app.ts index 34a79f873b5..c9c7a4cf5eb 100644 --- a/features/admin.core.v1/configs/app.ts +++ b/features/admin.core.v1/configs/app.ts @@ -210,7 +210,8 @@ export class Config { I18nConstants.APPLICATION_TEMPLATES_NAMESPACE, I18nConstants.ACTIONS_NAMESPACE, I18nConstants.TENANTS_NAMESPACE, - I18nConstants.REMOTE_USER_STORES_NAMESPACE + I18nConstants.REMOTE_USER_STORES_NAMESPACE, + I18nConstants.CUSTOM_AUTHENTICATION_NAMESPACE ], preload: [] }; diff --git a/features/admin.core.v1/constants/i18n-constants.ts b/features/admin.core.v1/constants/i18n-constants.ts index 3d9f1c6229d..20102f371ec 100644 --- a/features/admin.core.v1/constants/i18n-constants.ts +++ b/features/admin.core.v1/constants/i18n-constants.ts @@ -276,6 +276,12 @@ export class I18nConstants { */ public static readonly REMOTE_USER_STORES_NAMESPACE: string = I18nModuleConstants.REMOTE_USER_STORES_NAMESPACE; + /** + * Remote User Stores namespace. + */ + public static readonly CUSTOM_AUTHENTICATION_NAMESPACE: string = I18nModuleConstants. + CUSTOM_AUTHENTICATION_NAMESPACE; + /** * Locations of the I18n namespaces. */ @@ -327,7 +333,8 @@ export class I18nConstants { [ I18nConstants.IMPERSONATION_CONFIGURATION_NAMESPACE, "portals" ], [ I18nConstants.ACTIONS_NAMESPACE, "portals" ], [ I18nConstants.TENANTS_NAMESPACE, "portals" ], - [ I18nConstants.REMOTE_USER_STORES_NAMESPACE, "portals" ] + [ I18nConstants.REMOTE_USER_STORES_NAMESPACE, "portals" ], + [ I18nConstants.CUSTOM_AUTHENTICATION_NAMESPACE, "portals" ] ]); /** diff --git a/modules/i18n/src/models/namespaces/authentication-provider-ns.ts b/modules/i18n/src/models/namespaces/authentication-provider-ns.ts index adf005a40d1..4e0e92d1719 100644 --- a/modules/i18n/src/models/namespaces/authentication-provider-ns.ts +++ b/modules/i18n/src/models/namespaces/authentication-provider-ns.ts @@ -1316,6 +1316,10 @@ export interface AuthenticationProviderNS { message: string; description: string; }; + serverError: { + message: string; + description: string; + } success: { message: string; description: string; diff --git a/modules/i18n/src/models/namespaces/custom-auth-connection-ns.ts b/modules/i18n/src/models/namespaces/custom-auth-connection-ns.ts deleted file mode 100644 index 58e6f565588..00000000000 --- a/modules/i18n/src/models/namespaces/custom-auth-connection-ns.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). - * - * WSO2 LLC. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export interface customAuthConnectionNS { - fields: { - createWizard: { - authenticationTypeStep: { - label: string; - cardExternalAuthentication: { - header: string; - mainDescription: string; - examples: string; - }; - cardInternalUserAuthentication: { - header: string; - mainDescription: string; - examples: string; - }; - twoFactorAuthentication: { - header: string; - mainDescription: string; - examples: string; - } - }; - }; - }; -}; diff --git a/modules/i18n/src/models/namespaces/custom-authentication-ns.ts b/modules/i18n/src/models/namespaces/custom-authentication-ns.ts new file mode 100644 index 00000000000..c2869948260 --- /dev/null +++ b/modules/i18n/src/models/namespaces/custom-authentication-ns.ts @@ -0,0 +1,130 @@ +/** + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +export interface customAuthenticationNS { + fields: { + createWizard: { + authenticationTypeStep: { + label: string; + externalAuthenticationCard: { + header: string; + mainDescription: string; + examples: string; + }; + internalUserAuthenticationCard: { + header: string; + mainDescription: string; + examples: string; + }; + title: string; + twoFactorAuthenticationCard: { + header: string; + mainDescription: string; + examples: string; + } + }; + generalSettingsStep: { + title: string; + identifier: { + label: string; + hint: string; + placeholder: string; + validations: { + empty: string + invalid: string + }; + }; + displayName: { + label: string; + placeholder: string; + hint: string; + validations: { + empty: string + invalid: string + }; + }; + }; + configurationsStep: { + title: string; + endpoint: { + label: string; + placeholder: string; + hint: string; + validations: { + empty: string; + invalid: string; + general: string; + }; + }; + authenticationTypeDropdown: { + label: string; + placeholder: string; + hint: string; + authProperties: { + username: { + label: string; + placeholder: string; + validations: { + required: string; + }; + }; + password: { + label: string; + placeholder: string; + validations: { + required: string; + }; + }; + accessToken: { + label: string; + placeholder: string; + validations: { + required: string; + }; + }; + header: { + label: string; + placeholder: string; + validations: { + required: string; + invalid: string; + }; + }; + value: { + label: string; + placeholder: string; + validations: { + required: string; + }; + } + }; + validations: { + required: string; + }; + } + } + helpPanel: { + hint: { + header: string; + description: string; + warning: string; + } + } + }; + }; +}; diff --git a/modules/i18n/src/models/namespaces/index.ts b/modules/i18n/src/models/namespaces/index.ts index cb3444e1931..b5c3562e325 100644 --- a/modules/i18n/src/models/namespaces/index.ts +++ b/modules/i18n/src/models/namespaces/index.ts @@ -64,4 +64,4 @@ export * from "./actions-ns"; export * from "./tenants-ns"; export * from "./sms-templates-ns"; export * from "./remote-user-stores-ns"; -export * from "./custom-auth-connection-ns"; +export * from "./custom-authentication-ns"; diff --git a/modules/i18n/src/translations/en-US/portals/authentication-provider.ts b/modules/i18n/src/translations/en-US/portals/authentication-provider.ts index 69d1b79a870..181c50640c4 100644 --- a/modules/i18n/src/translations/en-US/portals/authentication-provider.ts +++ b/modules/i18n/src/translations/en-US/portals/authentication-provider.ts @@ -1065,6 +1065,10 @@ export const authenticationProvider:AuthenticationProviderNS = { description: "An error occurred while creating the connection.", message: "Create error" }, + serverError: { + description: "You are trying to add a provider with an existing Identity Provider Entity ID or a Service Provider Entity ID.", + message: "There's a Conflicting Entity" + }, success: { description: "Successfully created the connection.", message: "Create successful" diff --git a/modules/i18n/src/translations/en-US/portals/custom-auth-connection.ts b/modules/i18n/src/translations/en-US/portals/custom-auth-connection.ts index 52709a2026a..4ace5b2fb21 100644 --- a/modules/i18n/src/translations/en-US/portals/custom-auth-connection.ts +++ b/modules/i18n/src/translations/en-US/portals/custom-auth-connection.ts @@ -16,28 +16,118 @@ * under the License. */ -import { customAuthConnectionNS } from "../../../models"; +import { customAuthenticationNS } from "../../../models"; -export const customAuthentication: customAuthConnectionNS = { +export const customAuthentication: customAuthenticationNS = { fields: { createWizard: { authenticationTypeStep: { - cardExternalAuthentication: { + externalAuthenticationCard: { examples: "Eg: Social Login, Enterprise IdP", header: "External (Federated) User Authentication", mainDescription: "Authenticate and provision federated users." }, - cardInternalUserAuthentication: { + internalUserAuthenticationCard: { examples: "Eg: Username & Password, Email OTP", header: "Internal User Authentication", mainDescription: "Collect identifier and authenticate user accounts managed in the organization." }, label: "Select the authentication type you are implementing", - twoFactorAuthentication: { + title: "Authentication Type", + twoFactorAuthenticationCard: { examples: "Eg: TOTP", header: "2FA Authentication", mainDescription: "Only verify users in a second or later step in the login flow." } + }, + configurationsStep: { + authenticationTypeDropdown: { + authProperties: { + accessToken: { + label: "Access token", + placeholder: "Access Token", + validations: { + required: "Access Token is a required field." + } + }, + header: { + label: "Header", + placeholder: "Header", + validations: { + invalid: "Please choose a valid header name that adheres to the given guidelines.", + required: "Header is a required field." + } + }, + password: { + label: "Password", + placeholder: "Password", + validations: { + required: "Password is a required field." + } + }, + username: { + label: "Username", + placeholder: "Username", + validations: { + required: "Username is a required field." + } + }, + value: { + label: "Value", + placeholder: "Value", + validations: { + required: "Value is a required field." + } + } + }, + hint: "Once added, these secrets will not be displayed. You will only be able to reset them.", + label: "Authentication Scheme", + placeholder: "Select Authentication Type", + validations: { + required: "Authentication Type is a required field." + } + }, + endpoint: { + hint: "The URL of the configured external endpoint to integrate with the authenticator", + label: "Endpoint", + placeholder: "https://abc.external.authenticator/authenticate", + validations: { + empty: "Empty endpoint URI", + general: "Please enter a valid URL.", + invalid: "The entered URL is not HTTPS. Please add a valid URL." + } + }, + title: "Configuration" + }, + generalSettingsStep: { + displayName: { + hint: "", + label: "Identifier", + placeholder: "ABC Authenticator", + validations: { + empty: "", + invalid: "Invalid Display Name" + } + }, + identifier: { + hint: "", + label: "Identifier", + placeholder: "ABC_authenticator", + validations: { + empty: "", + invalid: "Invalid Identifier" + } + }, + title: "General Settings" + }, + helpPanel: { + hint: { + description: "We recommend using a URI as the identifier, but you do not need to make the URI" + + "publicly available since WSO2 Identity Server will not access your API. WSO2 Identity Server" + + "will use this identifier value as the audience(aud) claim in the issued JWT tokens.", + header: "Identifier", + warning: "This field should be unique; once created, it is not editable. " + } } } } diff --git a/modules/i18n/src/translations/en-US/portals/index.ts b/modules/i18n/src/translations/en-US/portals/index.ts index 5876aeccd67..c78b0154ebf 100644 --- a/modules/i18n/src/translations/en-US/portals/index.ts +++ b/modules/i18n/src/translations/en-US/portals/index.ts @@ -64,3 +64,4 @@ export * from "./actions"; export * from "./tenants"; export * from "./sms-templates"; export * from "./remote-user-stores"; +export * from "./custom-auth-connection";