Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove isLinkedAccountsEnabled extension config and improve UX in linked account config UI #7194

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/fuzzy-spoons-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/admin.applications.v1": patch
"@wso2is/admin.extensions.v1": patch
---

Remove `isLinkedAccountsEnabled` extension config
Original file line number Diff line number Diff line change
Expand Up @@ -648,30 +648,26 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
</Grid.Column>
</Grid.Row>
) }
{ applicationConfig?.attributeSettings?.advancedAttributeSettings
?.isLinkedAccountsEnabled(applicationTemplateId) &&
(<Grid.Row
columns={ 1 }
data-componentid="application-edit-user-attributes-linked-accounts"
>
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }>
<Divider />
<Heading
as="h4"
>
{ t("applications:forms.advancedAttributeSettings." +
<Grid.Row
columns={ 1 }
data-componentid="application-edit-user-attributes-linked-accounts"
>
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }>
<Divider />
<Heading
as="h4"
>
{ t("applications:forms.advancedAttributeSettings." +
"sections.linkedAccounts.heading") }
</Heading>
<Heading as="h6" color="grey">
{ t("applications:forms.advancedAttributeSettings." +
</Heading>
<Heading as="h6" color="grey" className="mt-1">
{ t("applications:forms.advancedAttributeSettings." +
"sections.linkedAccounts.descriptionFederated") }
</Heading>
</Grid.Column>
</Grid.Row>)
}
</Heading>
</Grid.Column>
</Grid.Row>

{
applicationConfig?.attributeSettings?.advancedAttributeSettings
?.isLinkedAccountsEnabled(applicationTemplateId) &&
applicationConfig?.attributeSettings?.advancedAttributeSettings
?.showValidateLinkedLocalAccount && (
<Grid.Row
Expand Down Expand Up @@ -705,36 +701,37 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
</Grid.Row>
)
}
{ applicationConfig?.attributeSettings?.advancedAttributeSettings
?.isLinkedAccountsEnabled(applicationTemplateId) &&
{
applicationConfig?.attributeSettings?.advancedAttributeSettings
?.showMandateLinkedLocalAccount ? (<div className="ml-3">
<Grid.Row columns={ 1 }>
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }>
<Field.CheckboxLegacy
listen={ mandateLinkedAccountCheckboxHandler }
disabled= { !validateLinkedLocalAccount }
ariaLabel="Mandate linked local account"
name="mandateLinkedLocalAccount"
label={
t("applications:forms.advancedAttributeSettings." +
<Grid.Row columns={ 1 }>
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }>
<Field.CheckboxLegacy
listen={ mandateLinkedAccountCheckboxHandler }
disabled= { !validateLinkedLocalAccount }
ariaLabel="Mandate linked local account"
name="mandateLinkedLocalAccount"
label={
t("applications:forms.advancedAttributeSettings." +
"sections.linkedAccounts.fields.mandateLocalAccount.label")
}
required={ false }
value={
mandateLinkedLocalAccount
? [ "mappedLocalSubjectMandatory" ]
: []
}
readOnly={ readOnly }
data-testid={ `${ componentId }-mandate-linked-local-account-checkbox` }
hint={ t("applications:forms.advancedAttributeSettings." +
}
required={ false }
value={
mandateLinkedLocalAccount
? [ "mappedLocalSubjectMandatory" ]
: []
}
readOnly={ readOnly }
data-testid={
`${ componentId }-mandate-linked-local-account-checkbox`
}
hint={ t("applications:forms.advancedAttributeSettings." +
"sections.linkedAccounts.fields.mandateLocalAccount.hint") }
/>
</Grid.Column>
</Grid.Row>
</div>)
: null
/>
</Grid.Column>
</Grid.Row>
</div>)
: null
}
{
applicationConfig?.attributeSettings?.advancedAttributeSettings
Expand Down
13 changes: 0 additions & 13 deletions features/admin.extensions.v1/configs/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,6 @@ export const applicationConfig: ApplicationConfig = {
},
attributeSettings: {
advancedAttributeSettings: {
isLinkedAccountsEnabled: (templateId: string): boolean => {
const allowedTemplates: string[] = [
ApplicationManagementConstants.CUSTOM_APPLICATION_PASSIVE_STS,
ApplicationManagementConstants.CUSTOM_APPLICATION_SAML,
ApplicationManagementConstants.TRADITIONAL_WEB_APPLICATION_SAML,
ApplicationManagementConstants.MOBILE,
ApplicationManagementConstants.CUSTOM_APPLICATION_OIDC,
ApplicationManagementConstants.TRADITIONAL_WEB_APPLICATION_OIDC,
ApplicationManagementConstants.SPA_APP_TEMPLATE_ID
];

return allowedTemplates.includes(templateId);
},
showIncludeTenantDomain: true,
showIncludeUserstoreDomainRole: true,
showIncludeUserstoreDomainSubject: true,
Expand Down
1 change: 0 additions & 1 deletion features/admin.extensions.v1/configs/models/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export interface ApplicationConfig {
hiddenGrantTypes: string[],
attributeSettings: {
advancedAttributeSettings: {
isLinkedAccountsEnabled: (templateId: string) => boolean;
showIncludeTenantDomain: boolean;
showIncludeUserstoreDomainRole: boolean;
showIncludeUserstoreDomainSubject: boolean;
Expand Down
13 changes: 6 additions & 7 deletions modules/i18n/src/translations/en-US/portals/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,17 +953,16 @@ export const applications: ApplicationsNS = {
message: "Invalid configuration",
description: "Linked local account validation should be enabled to mandate a linked local account"
},
heading: "Linked Accounts",
descriptionFederated: "Enable to retrieve user attributes of the linked local account during federated authentication.",
heading: "Attribute Resolution for Linked Accounts",
descriptionFederated: "Manage how user attributes are resolved when a local account is linked to a federated identity.",
fields: {
validateLocalAccount: {
label: "Prioritize local account attributes",
hint: "If a linked local account exists, its attributes are returned. Otherwise, " +
"attributes of the federated identity are returned."
label: "Use linked local account attributes",
hint: "If a linked local account exists, its attributes will be used. If no linked account is found,attributes of the federated user account will be used instead."
},
mandateLocalAccount: {
label: "Mandate linked local account",
hint: "Authentication will fail in token exchange grant if there is no linked local account with the federated identity."
label: "Require linked local account",
hint: "Authentication will fail if no linked local account is found during token exchange."
}
}
},
Expand Down
Loading