use of com.vaadin.data.ValidationResult in project cuba by cuba-platform.
the class CubaEditorImpl method getValidationErrors.
protected Map<Component, ValidationResult> getValidationErrors() {
Map<Component, ValidationResult> errors = new HashMap<>();
columnFields.values().forEach(field -> {
ValidationResult validationResult = ((CubaEditorField<?>) field).validate();
if (validationResult.isError()) {
errors.put(field, validationResult);
}
});
return errors;
}
use of com.vaadin.data.ValidationResult in project jmix by jmix-framework.
the class JmixEditorImpl method getValidationErrors.
protected Map<Component, ValidationResult> getValidationErrors() {
Map<Component, ValidationResult> errors = new HashMap<>();
columnFields.values().forEach(field -> {
ValidationResult validationResult = ((JmixEditorField<?>) field).validate();
if (validationResult.isError()) {
errors.put(field, validationResult);
}
});
return errors;
}
use of com.vaadin.data.ValidationResult in project unity by unity-idm.
the class AttributeStatementComponent method initUI.
private void initUI() {
extraAttributesGroupCB = new CheckBox(msg.getMessage("AttributeStatementComponent.extraGroupCB"));
extraAttributesGroupCB.addValueChangeListener((e) -> {
extraAttributesGroupCombo.setEnabled(extraAttributesGroupCB.getValue());
extraAttributesGroupCombo.setRequiredIndicatorVisible(extraAttributesGroupCB.getValue());
if (extraAttributesGroupCB.getValue() && extraAttributesGroupCombo.getValue() == null && !groups.isEmpty())
extraAttributesGroupCombo.setValue(extraAttributesGroupCombo.getAllGroups().get(0));
});
extraAttributesGroupCB.setDescription(msg.getMessage("AttributeStatementComponent.extraGroupCBDesc"));
extraAttributesGroupCombo = new GroupComboBox(msg.getMessage("AttributeStatementComponent.extraGroupSelect"), groups);
extraAttributesGroupCombo.setEnabled(false);
extraAttributesGroupCombo.setInput(group, false);
extraAttributesGroupCombo.setEmptySelectionAllowed(false);
extraAttributesGroupCombo.setRequiredIndicatorVisible(false);
if (groups.isEmpty())
extraAttributesGroupCB.setEnabled(false);
condition = new MVELExpressionField(msg, msg.getMessage("AttributeStatementComponent.condition"), msg.getMessage("MVELExpressionField.conditionDesc"), MVELExpressionContext.builder().withTitleKey("AttributeStatementComponent.conditionTitle").withEvalToKey("MVELExpressionField.evalToBoolean").withVars(AttributeStatementMVELContextKey.toMap()).build());
condition.setDescription(msg.getMessage("AttributeStatementComponent.conditionDesc"));
condition.setValue("true");
assignMode = new RadioButtonGroup<>();
Map<String, String> captions = ImmutableMap.of(MODE_DYNAMIC, msg.getMessage("AttributeStatementComponent.dynamicMode"), MODE_FIXED, msg.getMessage("AttributeStatementComponent.fixedMode"));
assignMode.setItems(captions.keySet());
assignMode.setItemCaptionGenerator(i -> captions.get(i));
assignMode.addValueChangeListener((e) -> {
boolean fixed = assignMode.getValue().equals(MODE_FIXED);
fixedAttribute.setVisible(fixed);
dynamicAttributeName.setVisible(!fixed);
dynamicAttributeValue.setVisible(!fixed);
});
dynamicAttributeName = new AttributeSelectionComboBox(msg.getMessage("AttributeStatementComponent.dynamicAttrName"), attributeTypes);
dynamicAttributeValue = new MVELExpressionField(msg, msg.getMessage("AttributeStatementComponent.dynamicAttrValue"), msg.getMessage("AttributeStatementComponent.dynamicAttrValueDesc"), MVELExpressionContext.builder().withTitleKey("AttributeStatementComponent.dynamicAttrValueTitle").withEvalToKey("AttributeStatementComponent.evalToListOfAttributeValues").withVars(AttributeStatementMVELContextKey.toMap()).build());
fixedAttribute = new AttributeFieldWithEdit(msg, msg.getMessage("AttributeStatementComponent.fixedAttr"), attrHandlerRegistry, attributeTypes, group, null, true);
assignMode.setValue(MODE_DYNAMIC);
conflictResolution = new ComboBox<AttributeStatement.ConflictResolution>(msg.getMessage("AttributeStatementEditDialog.conflictResolution"));
conflictResolution.setItems(AttributeStatement.ConflictResolution.values());
conflictResolution.setItemCaptionGenerator(item -> msg.getMessage("AttributeStatement.conflictResolution." + item.toString()));
conflictResolution.setValue(AttributeStatement.ConflictResolution.skip);
conflictResolution.setEmptySelectionAllowed(false);
FormLayout main = new CompactFormLayout();
setCompositionRoot(main);
main.addComponents(extraAttributesGroupCB, extraAttributesGroupCombo, condition, assignMode, dynamicAttributeName, dynamicAttributeValue, fixedAttribute, conflictResolution);
binder = new Binder<>(AttributeStatement.class);
binder.forField(extraAttributesGroupCombo).asRequired(msg.getMessage("fieldRequired")).bind("extraAttributesGroup");
condition.configureBinding(binder, "condition", true);
binder.forField(fixedAttribute).asRequired(msg.getMessage("fieldRequired")).bind("fixedAttribute");
Map<String, AttributeType> typesMap = attributeTypes.stream().collect(Collectors.toMap(t -> t.getName(), t -> t));
binder.forField(dynamicAttributeName).withConverter(d -> d != null ? d.getName() : "", d -> typesMap.get(d), "FOO").asRequired(new Validator<String>() {
@Override
public ValidationResult apply(String value, ValueContext context) {
if (StringUtils.isBlank(value) && assignMode.getValue().equals(MODE_DYNAMIC))
return ValidationResult.error(msg.getMessage("fieldRequired"));
else
return ValidationResult.ok();
}
}).bind("dynamicAttributeType");
dynamicAttributeValue.configureBinding(binder, "dynamicAttributeExpression", true);
binder.forField(conflictResolution).asRequired(msg.getMessage("fieldRequired")).bind("conflictResolution");
AttributeStatement attrStatment = new AttributeStatement();
attrStatment.setCondition(condition.getValue());
attrStatment.setConflictResolution(ConflictResolution.skip);
attrStatment.setExtraAttributesGroup(extraAttributesGroupCombo.getValue());
attrStatment.setDynamicAttributeType(dynamicAttributeName.getValue().getName());
binder.setBean(attrStatment);
}
use of com.vaadin.data.ValidationResult in project unity by unity-idm.
the class SAMLEditorGeneralTab method buildHeaderSection.
private Component buildHeaderSection() {
HorizontalLayout main = new HorizontalLayout();
main.setMargin(new MarginInfo(true, false));
FormLayoutWithFixedCaptionWidth mainGeneralLayout = new FormLayoutWithFixedCaptionWidth();
main.addComponent(mainGeneralLayout);
metaLinkButton = new Button();
metaOffInfo = new Label();
metaOffInfo.setCaption(msg.getMessage("SAMLEditorGeneralTab.metadataOff"));
infoLayout = new HorizontalLayout();
infoLayout.setMargin(new MarginInfo(false, true, false, true));
infoLayout.setStyleName("u-marginLeftMinus30");
infoLayout.addStyleName("u-border");
VerticalLayout wrapper = new VerticalLayout();
wrapper.setMargin(false);
infoLayout.addComponent(wrapper);
wrapper.addComponent(new Label(msg.getMessage("SAMLEditorGeneralTab.importantURLs")));
FormLayout infoLayoutWrapper = new FormLayout();
infoLayoutWrapper.setSpacing(false);
infoLayoutWrapper.setMargin(false);
wrapper.addComponent(infoLayoutWrapper);
metaLinkButtonWrapper = new HorizontalLayout();
metaLinkButtonWrapper.setCaption(msg.getMessage("SAMLEditorGeneralTab.metadataLink"));
metaLinkButton.setStyleName(Styles.vButtonLink.toString());
metaLinkButtonWrapper.addComponent(metaLinkButton);
infoLayoutWrapper.addComponent(metaLinkButtonWrapper);
infoLayoutWrapper.addComponent(metaOffInfo);
metaOffInfo.setVisible(false);
metaLinkButton.addClickListener(e -> {
Page.getCurrent().open(metaLinkButton.getCaption(), "_blank", false);
});
main.addComponent(infoLayout);
refreshMetaButton(false);
TextField name = new TextField();
name.setCaption(msg.getMessage("ServiceEditorBase.name"));
name.setReadOnly(editMode);
samlServiceBinder.forField(name).asRequired().bind("name");
mainGeneralLayout.addComponent(name);
TextField contextPath = new TextField();
contextPath.setPlaceholder("/saml-idp");
contextPath.setRequiredIndicatorVisible(true);
contextPath.setCaption(msg.getMessage("SAMLEditorGeneralTab.contextPath"));
contextPath.setReadOnly(editMode);
samlServiceBinder.forField(contextPath).withValidator((v, c) -> {
ValidationResult r;
if (editMode) {
r = validatePathForEdit(v);
} else {
r = validatePathForAdd(v);
}
if (!r.isError()) {
metaLinkButton.setCaption(serverPrefix + v + "/metadata");
}
return r;
}).bind("address");
mainGeneralLayout.addComponent(contextPath);
I18nTextField displayedName = new I18nTextField(msg);
displayedName.setCaption(msg.getMessage("ServiceEditorBase.displayedName"));
samlServiceBinder.forField(displayedName).bind("displayedName");
mainGeneralLayout.addComponent(displayedName);
TextField description = new DescriptionTextField(msg);
samlServiceBinder.forField(description).bind("description");
mainGeneralLayout.addComponent(description);
TextField issuerURI = new TextField();
issuerURI.setWidth(FieldSizeConstans.LINK_FIELD_WIDTH, FieldSizeConstans.LINK_FIELD_WIDTH_UNIT);
issuerURI.setCaption(msg.getMessage("SAMLEditorGeneralTab.issuerURI"));
configBinder.forField(issuerURI).asRequired().bind("issuerURI");
mainGeneralLayout.addComponent(issuerURI);
ComboBox<AssertionSigningPolicy> signAssertionPolicy = new ComboBox<>();
signAssertionPolicy.setItems(AssertionSigningPolicy.values());
signAssertionPolicy.setEmptySelectionAllowed(false);
signAssertionPolicy.setCaption(msg.getMessage("SAMLEditorGeneralTab.signAssertionPolicy"));
configBinder.forField(signAssertionPolicy).asRequired().bind("signAssertionPolicy");
mainGeneralLayout.addComponent(signAssertionPolicy);
ComboBox<ResponseSigningPolicy> signResponcePolicy = new ComboBox<>();
signResponcePolicy.setItems(ResponseSigningPolicy.values());
signResponcePolicy.setEmptySelectionAllowed(false);
signResponcePolicy.setCaption(msg.getMessage("SAMLEditorGeneralTab.signResponcePolicy"));
configBinder.forField(signResponcePolicy).asRequired().bind("signResponcePolicy");
mainGeneralLayout.addComponent(signResponcePolicy);
ComboBox<String> signResponseCredential = new ComboBox<>();
signResponseCredential.setCaption(msg.getMessage("SAMLEditorGeneralTab.signResponseCredential"));
signResponseCredential.setItems(credentials);
configBinder.forField(signResponseCredential).asRequired((v, c) -> ((v == null || v.isEmpty())) ? ValidationResult.error(msg.getMessage("fieldRequired")) : ValidationResult.ok()).bind("signResponseCredential");
mainGeneralLayout.addComponent(signResponseCredential);
ComboBox<String> httpsTruststore = new ComboBox<>(msg.getMessage("SAMLEditorGeneralTab.httpsTruststore"));
httpsTruststore.setItems(truststores);
configBinder.forField(httpsTruststore).bind("httpsTruststore");
mainGeneralLayout.addComponent(httpsTruststore);
CheckBox skipConsentScreen = new CheckBox(msg.getMessage("SAMLEditorGeneralTab.skipConsentScreen"));
configBinder.forField(skipConsentScreen).bind("skipConsentScreen");
mainGeneralLayout.addComponent(skipConsentScreen);
CheckBox editableConsentScreen = new CheckBox(msg.getMessage("SAMLEditorGeneralTab.editableConsentScreen"));
configBinder.forField(editableConsentScreen).bind("editableConsentScreen");
mainGeneralLayout.addComponent(editableConsentScreen);
skipConsentScreen.addValueChangeListener(e -> editableConsentScreen.setEnabled(!e.getValue()));
ComboBox<RequestAcceptancePolicy> acceptPolicy = new ComboBox<>();
acceptPolicy.setItems(RequestAcceptancePolicy.values());
acceptPolicy.setEmptySelectionAllowed(false);
acceptPolicy.setCaption(msg.getMessage("SAMLEditorGeneralTab.acceptPolicy"));
configBinder.forField(acceptPolicy).asRequired().bind("requestAcceptancePolicy");
mainGeneralLayout.addComponent(acceptPolicy);
return main;
}
use of com.vaadin.data.ValidationResult in project unity by unity-idm.
the class OAuthEditorGeneralTab method buildHeaderSection.
private Component buildHeaderSection() {
HorizontalLayout main = new HorizontalLayout();
main.setMargin(new MarginInfo(true, false));
FormLayoutWithFixedCaptionWidth mainGeneralLayout = new FormLayoutWithFixedCaptionWidth();
main.addComponent(mainGeneralLayout);
HorizontalLayout infoLayout = new HorizontalLayout();
infoLayout.setMargin(new MarginInfo(false, true, false, true));
infoLayout.setStyleName("u-marginLeftMinus30");
infoLayout.addStyleName("u-border");
VerticalLayout wrapper = new VerticalLayout();
wrapper.setMargin(false);
infoLayout.addComponent(wrapper);
wrapper.addComponent(new Label(msg.getMessage("OAuthEditorGeneralTab.importantURLs")));
FormLayout infoLayoutWrapper = new FormLayout();
infoLayoutWrapper.setSpacing(false);
infoLayoutWrapper.setMargin(false);
wrapper.addComponent(infoLayoutWrapper);
Label userAuthnEndpointPath = new Label();
userAuthnEndpointPath.setCaption(msg.getMessage("OAuthEditorGeneralTab.userAuthnEndpointPath"));
infoLayoutWrapper.addComponent(userAuthnEndpointPath);
main.addComponent(infoLayout);
Label tokenEndpointPath = new Label();
tokenEndpointPath.setCaption(msg.getMessage("OAuthEditorGeneralTab.tokenEndpointPath"));
infoLayoutWrapper.addComponent(tokenEndpointPath);
Button metaPath = new Button();
if (editMode) {
HorizontalLayout l = new HorizontalLayout();
l.setCaption(msg.getMessage("OAuthEditorGeneralTab.metadataLink"));
metaPath.setStyleName(Styles.vButtonLink.toString());
l.addComponent(metaPath);
infoLayoutWrapper.addComponent(l);
metaPath.addClickListener(e -> Page.getCurrent().open(metaPath.getCaption(), "_blank", false));
}
name = new TextField();
name.setCaption(msg.getMessage("ServiceEditorBase.name"));
name.setReadOnly(editMode);
oauthWebAuthzBinder.forField(name).asRequired().bind("name");
mainGeneralLayout.addComponent(name);
TextField tokenContextPath = new TextField();
TextField webAuthzContextPath = new TextField();
webAuthzContextPath.setRequiredIndicatorVisible(true);
webAuthzContextPath.setCaption(msg.getMessage("OAuthEditorGeneralTab.usersAuthnPath"));
webAuthzContextPath.setReadOnly(editMode);
webAuthzContextPath.setPlaceholder("/oauth");
oauthWebAuthzBinder.forField(webAuthzContextPath).withValidator((v, c) -> {
ValidationResult r;
if (editMode) {
r = validatePathForEdit(v);
} else {
r = validatePathForAdd(v, tokenContextPath.getValue());
}
if (r.isError()) {
userAuthnEndpointPath.setValue("");
} else {
userAuthnEndpointPath.setValue(serverPrefix + v + OAuthAuthzWebEndpoint.OAUTH_CONSUMER_SERVLET_PATH);
}
return r;
}).bind("address");
mainGeneralLayout.addComponent(webAuthzContextPath);
tokenContextPath.setRequiredIndicatorVisible(true);
tokenContextPath.setCaption(msg.getMessage("OAuthEditorGeneralTab.clientTokenPath"));
tokenContextPath.setPlaceholder("/oauth-token");
tokenContextPath.setReadOnly(editMode);
oauthTokenBinder.forField(tokenContextPath).withValidator((v, c) -> {
ValidationResult r;
if (editMode) {
r = validatePathForEdit(v);
} else {
r = validatePathForAdd(v, webAuthzContextPath.getValue());
}
if (r.isError()) {
tokenEndpointPath.setValue("");
} else {
tokenEndpointPath.setValue(serverPrefix + v + OAuthTokenEndpoint.TOKEN_PATH);
metaPath.setCaption(serverPrefix + v + "/.well-known/openid-configuration");
}
return r;
}).bind("address");
mainGeneralLayout.addComponent(tokenContextPath);
I18nTextField displayedName = new I18nTextField(msg);
displayedName.setCaption(msg.getMessage("ServiceEditorBase.displayedName"));
oauthWebAuthzBinder.forField(displayedName).bind("displayedName");
mainGeneralLayout.addComponent(displayedName);
TextField description = new DescriptionTextField(msg);
oauthWebAuthzBinder.forField(description).bind("description");
mainGeneralLayout.addComponent(description);
TextField issuerURI = new TextField();
issuerURI.setPlaceholder(msg.getMessage("OAuthEditorGeneralTab.issuerURIPlaceholder"));
issuerURI.setWidth(FieldSizeConstans.LINK_FIELD_WIDTH, FieldSizeConstans.LINK_FIELD_WIDTH_UNIT);
issuerURI.setCaption(msg.getMessage("OAuthEditorGeneralTab.issuerURI"));
configBinder.forField(issuerURI).asRequired().bind("issuerURI");
mainGeneralLayout.addComponent(issuerURI);
IntStepper idTokenExp = new IntStepper();
idTokenExp.setWidth(5, Unit.EM);
idTokenExp.setCaption(msg.getMessage("OAuthEditorGeneralTab.idTokenExpiration"));
configBinder.forField(idTokenExp).asRequired(msg.getMessage("notAPositiveNumber")).withValidator(new IntegerRangeValidator(msg.getMessage("notAPositiveNumber"), 1, null)).bind("idTokenExpiration");
mainGeneralLayout.addComponent(idTokenExp);
IntStepper codeTokenExp = new IntStepper();
codeTokenExp.setWidth(5, Unit.EM);
codeTokenExp.setCaption(msg.getMessage("OAuthEditorGeneralTab.codeTokenExpiration"));
configBinder.forField(codeTokenExp).asRequired(msg.getMessage("notAPositiveNumber")).withValidator(new IntegerRangeValidator(msg.getMessage("notAPositiveNumber"), 1, null)).bind("codeTokenExpiration");
mainGeneralLayout.addComponent(codeTokenExp);
IntStepper accessTokenExp = new IntStepper();
accessTokenExp.setWidth(5, Unit.EM);
accessTokenExp.setCaption(msg.getMessage("OAuthEditorGeneralTab.accessTokenExpiration"));
configBinder.forField(accessTokenExp).asRequired(msg.getMessage("notAPositiveNumber")).withValidator(new IntegerRangeValidator(msg.getMessage("notAPositiveNumber"), 1, null)).bind("accessTokenExpiration");
mainGeneralLayout.addComponent(accessTokenExp);
IntStepper refreshTokenExp = new IntStepper();
EnumComboBox<RefreshTokenIssuePolicy> refreshTokenIssuePolicy = new EnumComboBox<>(msg, "OAuthEditorGeneralTab.refreshTokenIssuePolicy.", RefreshTokenIssuePolicy.class, RefreshTokenIssuePolicy.NEVER);
refreshTokenExp.setDescription(msg.getMessage("OAuthEditorGeneralTab.refreshTokenExpirationDescription"));
TooltipExtension.tooltip(refreshTokenExp);
refreshTokenIssuePolicy.setCaption(msg.getMessage("OAuthEditorGeneralTab.refreshTokenIssuePolicy"));
refreshTokenIssuePolicy.setEmptySelectionAllowed(false);
configBinder.forField(refreshTokenIssuePolicy).bind("refreshTokenIssuePolicy");
mainGeneralLayout.addComponent(refreshTokenIssuePolicy);
refreshTokenIssuePolicy.addValueChangeListener(e -> {
refreshTokenExp.setEnabled(!e.getValue().equals(RefreshTokenIssuePolicy.NEVER));
refreshScope(e.getValue().equals(RefreshTokenIssuePolicy.OFFLINE_SCOPE_BASED), OIDCScopeValue.OFFLINE_ACCESS, msg.getMessage("OAuthEditorGeneralTab.defaultOfflineAccessScopeDesc"));
});
refreshTokenExp.setWidth(5, Unit.EM);
refreshTokenExp.setCaption(msg.getMessage("OAuthEditorGeneralTab.refreshTokenExpiration"));
configBinder.forField(refreshTokenExp).asRequired(msg.getMessage("notAPositiveNumber")).withValidator(new IntegerRangeValidator(msg.getMessage("notAPositiveNumber"), 0, null)).bind("refreshTokenExpiration");
refreshTokenExp.setEnabled(false);
mainGeneralLayout.addComponent(refreshTokenExp);
IntStepper extendAccessTokenValidity = new IntStepper();
CheckBox supportExtendAccessTokenValidity = new CheckBox(msg.getMessage("OAuthEditorGeneralTab.supportExtendTokenValidity"));
configBinder.forField(supportExtendAccessTokenValidity).bind("supportExtendTokenValidity");
mainGeneralLayout.addComponent(supportExtendAccessTokenValidity);
supportExtendAccessTokenValidity.addValueChangeListener(e -> extendAccessTokenValidity.setEnabled(e.getValue()));
extendAccessTokenValidity.setWidth(5, Unit.EM);
extendAccessTokenValidity.setCaption(msg.getMessage("OAuthEditorGeneralTab.maxExtendAccessTokenValidity"));
configBinder.forField(extendAccessTokenValidity).asRequired((v, c) -> {
if (supportExtendAccessTokenValidity.getValue()) {
return new IntegerRangeValidator(msg.getMessage("notAPositiveNumber"), 1, null).apply(v, c);
}
return ValidationResult.ok();
}).bind("maxExtendAccessTokenValidity");
extendAccessTokenValidity.setEnabled(false);
mainGeneralLayout.addComponent(extendAccessTokenValidity);
CheckBox skipConsentScreen = new CheckBox(msg.getMessage("OAuthEditorGeneralTab.skipConsentScreen"));
configBinder.forField(skipConsentScreen).bind("skipConsentScreen");
mainGeneralLayout.addComponent(skipConsentScreen);
accessTokenFormat = createAccessTokenFormatCombo();
mainGeneralLayout.addComponent(accessTokenFormat);
openIDConnect = new CheckBox(msg.getMessage("OAuthEditorGeneralTab.openIDConnect"));
configBinder.forField(openIDConnect).bind("openIDConnect");
mainGeneralLayout.addComponent(openIDConnect);
signingAlg = new ComboBox<>();
signingAlg.setCaption(msg.getMessage("OAuthEditorGeneralTab.signingAlgorithm"));
signingAlg.setEmptySelectionAllowed(false);
signingAlg.setItems(SigningAlgorithms.values());
configBinder.forField(signingAlg).bind("signingAlg");
mainGeneralLayout.addComponent(signingAlg);
signingAlg.addValueChangeListener(e -> refreshSigningControls());
credential = new ComboBox<>();
credential.setCaption(msg.getMessage("OAuthEditorGeneralTab.signingCredential"));
credential.setEmptySelectionAllowed(false);
credential.setItems(credentials);
configBinder.forField(credential).asRequired((v, c) -> {
if (credential.isEnabled() && (v == null || v.isEmpty()) && !Family.HMAC_SHA.contains(JWSAlgorithm.parse(signingAlg.getValue().toString()))) {
return ValidationResult.error(msg.getMessage("fieldRequired"));
}
return ValidationResult.ok();
}).bind("credential");
credential.setEnabled(false);
mainGeneralLayout.addComponent(credential);
signingSecret = new TextField();
signingSecret.setWidth(FieldSizeConstans.WIDE_FIELD_WIDTH, FieldSizeConstans.WIDE_FIELD_WIDTH_UNIT);
signingSecret.setCaption(msg.getMessage("OAuthEditorGeneralTab.signingSecret"));
configBinder.forField(signingSecret).asRequired((v, c) -> {
JWSAlgorithm alg = JWSAlgorithm.parse(signingAlg.getValue().toString());
if (signingSecret.isEnabled() && Family.HMAC_SHA.contains(alg)) {
if (v == null || v.isEmpty()) {
return ValidationResult.error(msg.getMessage("fieldRequired"));
} else {
if (v.getBytes(StandardCharsets.UTF_8).length * 8 < getBitsLenghtForAlg(alg)) {
return ValidationResult.error(msg.getMessage("toShortValue"));
}
}
}
return ValidationResult.ok();
}).bind("signingSecret");
signingSecret.setEnabled(false);
mainGeneralLayout.addComponent(signingSecret);
openIDConnect.addValueChangeListener(e -> {
refreshSigningControls();
refreshScope(e.getValue(), OIDCScopeValue.OPENID, msg.getMessage("OAuthEditorGeneralTab.defaultOpenidScopeDesc"));
});
return main;
}
Aggregations