Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ProviderConfigurationBuilder ignores required properties #26963

@fabiankuenzer

Description

@fabiankuenzer

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

identity-brokering

Describe the bug

I implemented a custom IdentityProvider and defined configurable properties by using the ProviderConfigurationBuilder as described here. I made some of the properties required with .required(true).

There are two problems:

  1. If the required property is a STRING_TYPE, it is marked as required with a red star in the UI. Nevertheless, there is no error when the property is left blank.
  2. If the required property is a FILE_TYPE, it is not even marked as required with a red star in the UI. Also, there is no error if the property is left blank.

Version

23.0.6

Expected behavior

When a property is defined to be required, I expect two behaviours:

  1. It is marked as required in the UI with a red star.
  2. If it is left blank, an error should be displayed in the UI.

Actual behavior

The red star is only shown for STRING_TYPE properties but not for FILE_TYPE properties. Moreover, for both property types, there is no error if the respective fields are left blank.

How to Reproduce?

Implement a custom IdentityProvider and use the following settings in the IdentityProviderFactory:

@Override
  public List<ProviderConfigProperty> getConfigProperties() {
    return ProviderConfigurationBuilder.create()
        .property()
        .name("foo")
        .type(ProviderConfigProperty.STRING_TYPE)
        .label("foo")
        .helpText("foo")
        .required(true)
        .add()
        .property()
        .name("bar")
        .type(ProviderConfigProperty.FILE_TYPE)
        .label("bar")
        .helpText("bar")
        .required(true)
        .add()
        .build();
  }

Log into the admin UI and add the custom identity provider. Now, the settings of the fields behave as described.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions