Identity providers(mappers): update form fields for all Social mapper types (#1304)
Co-authored-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
parent
c71d21c748
commit
8917744c04
6 changed files with 508 additions and 456 deletions
|
@ -272,6 +272,20 @@ describe("Identity provider test", () => {
|
||||||
masthead.checkNotificationMessage(createMapperSuccessMsg);
|
masthead.checkNotificationMessage(createMapperSuccessMsg);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should add Social mapper of type Attribute Importer", () => {
|
||||||
|
sidebarPage.goToIdentityProviders();
|
||||||
|
|
||||||
|
listingPage.goToItemDetails("facebook");
|
||||||
|
|
||||||
|
addMapperPage.goToMappersTab();
|
||||||
|
|
||||||
|
addMapperPage.addMapper();
|
||||||
|
|
||||||
|
addMapperPage.fillSocialMapper("facebook attribute importer");
|
||||||
|
|
||||||
|
masthead.checkNotificationMessage(createMapperSuccessMsg);
|
||||||
|
});
|
||||||
|
|
||||||
it("should edit Username Template Importer mapper", () => {
|
it("should edit Username Template Importer mapper", () => {
|
||||||
sidebarPage.goToIdentityProviders();
|
sidebarPage.goToIdentityProviders();
|
||||||
|
|
||||||
|
@ -293,7 +307,7 @@ describe("Identity provider test", () => {
|
||||||
|
|
||||||
addMapperPage.goToMappersTab();
|
addMapperPage.goToMappersTab();
|
||||||
|
|
||||||
listingPage.goToItemDetails("facebook mapper");
|
listingPage.goToItemDetails("facebook attribute importer");
|
||||||
|
|
||||||
addMapperPage.editSocialMapper();
|
addMapperPage.editSocialMapper();
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,7 +9,10 @@ export default class AddMapperPage {
|
||||||
private mapperRoleInput = "mapper-role-input";
|
private mapperRoleInput = "mapper-role-input";
|
||||||
private attributeName = "attribute-name";
|
private attributeName = "attribute-name";
|
||||||
private attributeFriendlyName = "attribute-friendly-name";
|
private attributeFriendlyName = "attribute-friendly-name";
|
||||||
|
private attributeValue = "attribute-value";
|
||||||
private claimInput = "claim";
|
private claimInput = "claim";
|
||||||
|
private claimValueInput = "claim-value-input";
|
||||||
|
private socialProfileJSONfieldPath = "social-profile-JSON-field-path";
|
||||||
private userAttribute = "user-attribute";
|
private userAttribute = "user-attribute";
|
||||||
private userAttributeName = "user-attribute-name";
|
private userAttributeName = "user-attribute-name";
|
||||||
private userAttributeValue = "user-attribute-value";
|
private userAttributeValue = "user-attribute-value";
|
||||||
|
@ -73,14 +76,17 @@ export default class AddMapperPage {
|
||||||
.contains("Attribute Importer")
|
.contains("Attribute Importer")
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.findByTestId(this.userSessionAttribute).clear();
|
cy.findByTestId(this.socialProfileJSONfieldPath).clear();
|
||||||
cy.findByTestId(this.userSessionAttribute).type("user session attribute");
|
cy.findByTestId(this.socialProfileJSONfieldPath).type(
|
||||||
cy.findByTestId(this.userSessionAttributeValue).clear();
|
"social profile JSON field path"
|
||||||
|
|
||||||
cy.findByTestId(this.userSessionAttributeValue).type(
|
|
||||||
"user session attribute value"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
cy.findByTestId(this.userAttributeName).clear();
|
||||||
|
|
||||||
|
cy.findByTestId(this.userAttributeName).type("user attribute name");
|
||||||
|
|
||||||
|
this.saveNewMapper();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,16 +338,16 @@ export default class AddMapperPage {
|
||||||
|
|
||||||
cy.findByTestId("inherit").click();
|
cy.findByTestId("inherit").click();
|
||||||
|
|
||||||
cy.findByTestId(this.userSessionAttribute).clear();
|
cy.findByTestId(this.socialProfileJSONfieldPath).clear();
|
||||||
cy.findByTestId(this.userSessionAttribute).type(
|
|
||||||
"user session attribute_edited"
|
|
||||||
);
|
|
||||||
cy.findByTestId(this.userSessionAttributeValue).clear();
|
|
||||||
|
|
||||||
cy.findByTestId(this.userSessionAttributeValue).type(
|
cy.findByTestId(this.socialProfileJSONfieldPath).type(
|
||||||
"user session attribute value_edited"
|
"social profile JSON field path edited"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
cy.findByTestId(this.userAttributeName).clear();
|
||||||
|
|
||||||
|
cy.findByTestId(this.userAttributeName).type("user attribute name edited");
|
||||||
|
|
||||||
this.saveNewMapper();
|
this.saveNewMapper();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -20,11 +20,11 @@ import type { IdPMapperRepresentationWithAttributes } from "./AddMapper";
|
||||||
type AddMapperFormProps = {
|
type AddMapperFormProps = {
|
||||||
mapperTypes?: Record<string, IdentityProviderMapperRepresentation>;
|
mapperTypes?: Record<string, IdentityProviderMapperRepresentation>;
|
||||||
mapperType: string;
|
mapperType: string;
|
||||||
providerId: string;
|
|
||||||
id: string;
|
id: string;
|
||||||
updateMapperType: (mapperType: string) => void;
|
updateMapperType: (mapperType: string) => void;
|
||||||
form: UseFormMethods<IdPMapperRepresentationWithAttributes>;
|
form: UseFormMethods<IdPMapperRepresentationWithAttributes>;
|
||||||
formValues: IdPMapperRepresentationWithAttributes;
|
formValues: IdPMapperRepresentationWithAttributes;
|
||||||
|
isSocialIdP: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AddMapperForm = ({
|
export const AddMapperForm = ({
|
||||||
|
@ -34,6 +34,7 @@ export const AddMapperForm = ({
|
||||||
id,
|
id,
|
||||||
updateMapperType,
|
updateMapperType,
|
||||||
formValues,
|
formValues,
|
||||||
|
isSocialIdP,
|
||||||
}: AddMapperFormProps) => {
|
}: AddMapperFormProps) => {
|
||||||
const { t } = useTranslation("identity-providers");
|
const { t } = useTranslation("identity-providers");
|
||||||
|
|
||||||
|
@ -129,7 +130,9 @@ export const AddMapperForm = ({
|
||||||
helpText={
|
helpText={
|
||||||
formValues.identityProviderMapper ===
|
formValues.identityProviderMapper ===
|
||||||
"saml-user-attribute-idp-mapper" &&
|
"saml-user-attribute-idp-mapper" &&
|
||||||
(providerId === "oidc" || providerId === "keycloak-oidc")
|
(providerId === "oidc" ||
|
||||||
|
providerId === "keycloak-oidc" ||
|
||||||
|
isSocialIdP)
|
||||||
? `identity-providers-help:oidcAttributeImporter`
|
? `identity-providers-help:oidcAttributeImporter`
|
||||||
: `identity-providers-help:${mapperType}`
|
: `identity-providers-help:${mapperType}`
|
||||||
}
|
}
|
||||||
|
@ -142,7 +145,9 @@ export const AddMapperForm = ({
|
||||||
<Controller
|
<Controller
|
||||||
name="identityProviderMapper"
|
name="identityProviderMapper"
|
||||||
defaultValue={
|
defaultValue={
|
||||||
providerId === "saml"
|
isSocialIdP
|
||||||
|
? `${providerId.toLowerCase()}-user-attribute-mapper`
|
||||||
|
: providerId === "saml"
|
||||||
? "saml-advanced-role-idp-mapper"
|
? "saml-advanced-role-idp-mapper"
|
||||||
: "oidc-advanced-role-idp-mapper"
|
: "oidc-advanced-role-idp-mapper"
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,6 +136,8 @@ export default {
|
||||||
userAttribute: "Name of user attribute you want to hardcode",
|
userAttribute: "Name of user attribute you want to hardcode",
|
||||||
claim:
|
claim:
|
||||||
"Name of claim to search for in token. You can reference nested claims by using a '.', i.e. 'address.locality'. To use dot (.) literally, escape it with backslash. (\\.)",
|
"Name of claim to search for in token. You can reference nested claims by using a '.', i.e. 'address.locality'. To use dot (.) literally, escape it with backslash. (\\.)",
|
||||||
|
socialProfileJSONFieldPath:
|
||||||
|
"Path of field in Social Provider User Profile JSON data to get value from. You can use dot notation for nesting and square brackets for array index. E.g. 'contact.address[0].country'.",
|
||||||
userAttributeValue: "Value you want to hardcode",
|
userAttributeValue: "Value you want to hardcode",
|
||||||
attributeName:
|
attributeName:
|
||||||
"Name of attribute to search for in assertion. You can leave this blank and specify a friendly name instead.",
|
"Name of attribute to search for in assertion. You can leave this blank and specify a friendly name instead.",
|
||||||
|
@ -143,6 +145,7 @@ export default {
|
||||||
"Friendly name of attribute to search for in assertion. You can leave this blank and specify a name instead.",
|
"Friendly name of attribute to search for in assertion. You can leave this blank and specify a name instead.",
|
||||||
userAttributeName:
|
userAttributeName:
|
||||||
"User attribute name to store SAML attribute. Use email, lastName, and firstName to map to those predefined user properties.",
|
"User attribute name to store SAML attribute. Use email, lastName, and firstName to map to those predefined user properties.",
|
||||||
|
socialUserAttributeName: "User attribute name to store information.",
|
||||||
attributeValue:
|
attributeValue:
|
||||||
"Value the attribute must have. If the attribute is a list, then the value must be contained in the list.",
|
"Value the attribute must have. If the attribute is a list, then the value must be contained in the list.",
|
||||||
attributes:
|
attributes:
|
||||||
|
|
|
@ -74,6 +74,7 @@ export default {
|
||||||
claim: "Claim",
|
claim: "Claim",
|
||||||
claimValue: "Claim Value",
|
claimValue: "Claim Value",
|
||||||
claims: "Claims",
|
claims: "Claims",
|
||||||
|
socialProfileJSONFieldPath: "Social Profile JSON Field Path",
|
||||||
mapperAttributeName: "Attribute Name",
|
mapperAttributeName: "Attribute Name",
|
||||||
mapperUserAttributeName: "User Attribute Name",
|
mapperUserAttributeName: "User Attribute Name",
|
||||||
mapperAttributeFriendlyName: "Friendly name",
|
mapperAttributeFriendlyName: "Friendly name",
|
||||||
|
|
Loading…
Reference in a new issue