Skip to main content
Version: 4

Custom implementation

While using SAML SSO to log in to the system, the SAML response can be interpreted to change the default behavior to make the user log in to a specific company/partner in a specific role. Adeptia Connect enables you to do this by implementing a custom class to read and authenticate the user information. To achieve this, you need to define a new Java class and place that in the customClasses folder.

Success

To ensure better security, you can place the custom classes in a JAR and then put the JAR in the ext folder in the shared PVC, as shown in the example below.

/shared/ext/<JAR name>

Furthermore, if you want the system to read the custom classes only from the JAR files, set the value for the property customClasses.readMode.jarOnly to true. The default value for this property is false. You can find this property by navigating to Account > Settings > Microservice Settings > WebRunner.

This option lets you:

  • Access custom attributes and relay state information present in the SAML response
  • Provide a specific company/partner and also a specific role for logged in user
  • Provide a redirect URL to which the user will be redirected after a successful login

Follow the steps below to create the custom class:

  1. Create a new Java class that implements the below interface.

    InformationThis interface provides the ability to define a custom implementation for providing the authenticated user information.

    SAML SSO Authentication Interface

    SAML SSO Authentication Interface

  2. Annotate the custom class with @Component, and @Scope annotations. 

    1. Provide the name of the component, for example, "****SAMLUserDetailsImpl", as the value for Component annotation, and "prototype" as the value for Scope annotation.
    2. Put a constructor in this class. 

    Expand 'SAML User Details IMPL' for an example of an implementation class: 

    SAML user details IMPL

    SAML User Details IMPL

  3. Define the following environment variable in the portal section of the global values.yaml file to store the name of the implementation class (Name of the component).

    Variable NameValueDescription
    SAML_SSO_IMPLEMENTATION_BEANSAMLUserDetailsImplThis variable contains the name of the component.
  4. Compile the above class and place it in customClasses folder.

  5. Restart the Adeptia services to bring the changes into effect.