Interface AuthenticationProvider


  • public interface AuthenticationProvider
    Interface for an authentication provider. With this interface you can add your own authentication mechanism. If you want to register your custom provider, then you will need to write a server plugin. In the method ServerPlugin.registerExtension(ServerPluginManager spm ) of your server plugin you write:
    
     spm.register( AuthenticationProvider.class, new YourCustomAuthenticationProvider() );
     
    to register your provider.
    Since:
    inetcore 1.1
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default java.util.Map<java.lang.String,​java.lang.String> applySettings​(java.util.Map<java.lang.String,​java.lang.String> clientProperties, Configuration config)
      Deprecated, for removal: This API element is subject to removal in a future version.
      default java.util.Map<java.lang.String,​java.lang.String> applySettings​(java.util.Map<java.lang.String,​java.lang.String> clientProperties, Configuration config, java.util.List<java.util.Map<java.lang.String,​java.lang.String>> originalInConfig)
      Convert the properties from the GUI to the properties that should be saved.
      LoginProcessor create​(AuthenticationDescription description)
      Create an instance of LoginProcessor for the given description.
      LoginProcessor createLoginProcessor​(AuthenticationDescription description, java.lang.String authorization, javax.servlet.http.HttpServletRequest request, boolean isApplication)
      Create an instance of a LoginProcessor if possible.
      AuthenticationDescription getAuthenticationDescription​(java.util.Map<java.lang.String,​java.lang.String> settings, boolean isApplication, boolean isProxy)
      Get the AuthenticationDescription for the given configuration settings and logging
      java.lang.String getDisplayName​(java.util.Map<java.lang.String,​java.lang.String> settings)
      Get the display name for the GUI.
      int getPriority()
      The order of providers if the "automatic" login method is selected and the order in drop down boxes of the GUI is determined using this priority value.
      default boolean hasAdditionalConfigurationAction()
      Returns true, if the provider has an additional configuration page when adding the provider to the list of available login provider.
      default boolean isMultipleDescriptionSupported()
      Returns if the provider supports multiple AuthenticationDescription.
      java.lang.String name()
      The unique name of this provider.
      default void transformGuiProperties​(java.util.Map<java.lang.String,​java.lang.Object> properties)
      Transform the loaded values to the format needed for the configuration GUI
    • Method Detail

      • name

        @Nonnull
        java.lang.String name()
        The unique name of this provider. It is used to save this provider in the configuration.
        Returns:
        the name - must be unique
        Since:
        inetcore 1.1
      • getPriority

        int getPriority()
        The order of providers if the "automatic" login method is selected and the order in drop down boxes of the GUI is determined using this priority value.
        Returns:
        the priority value for where to place this provider in lists of providers
        Since:
        inetcore 1.1
      • create

        @Nonnull
        LoginProcessor create​(AuthenticationDescription description)
        Create an instance of LoginProcessor for the given description.
        Parameters:
        description - the description of the login
        Returns:
        a login processor
        Since:
        inetcore 4.0
      • createLoginProcessor

        @Nullable
        LoginProcessor createLoginProcessor​(AuthenticationDescription description,
                                            @Nullable
                                            java.lang.String authorization,
                                            javax.servlet.http.HttpServletRequest request,
                                            boolean isApplication)
        Create an instance of a LoginProcessor if possible. It also try to login.

        If the description is invalid then it return null. It also returns null if the given Authorization header is not supported.

        Parameters:
        description - the description of the login
        authorization - the current HTTP Authorization header
        request - current request
        isApplication - true, if the request come NOT from a browser.
        Returns:
        a LoginProcessor
        Since:
        inetcore 3.2
      • getDisplayName

        @Nonnull
        java.lang.String getDisplayName​(@Nullable
                                        java.util.Map<java.lang.String,​java.lang.String> settings)
        Get the display name for the GUI.
        Parameters:
        settings - the settings in the configuration manager
        Returns:
        the display name
        Since:
        inetcore 4.0
      • getAuthenticationDescription

        @Nullable
        AuthenticationDescription getAuthenticationDescription​(@Nonnull
                                                               java.util.Map<java.lang.String,​java.lang.String> settings,
                                                               boolean isApplication,
                                                               boolean isProxy)
        Get the AuthenticationDescription for the given configuration settings and logging
        Parameters:
        settings - the settings in the configuration manager
        isApplication - if the call was make from an application
        isProxy - if the call was make through an proxy
        Returns:
        the description or null if not possible for the given settings
        Since:
        inetcore 4.0
      • applySettings

        @Deprecated(since="22.10",
                    forRemoval=true)
        @Nonnull
        default java.util.Map<java.lang.String,​java.lang.String> applySettings​(java.util.Map<java.lang.String,​java.lang.String> clientProperties,
                                                                                     Configuration config)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Convert the properties from the GUI to the properties that should be saved. Typical this is a filter only.
        Parameters:
        clientProperties - properties from the GUI
        config - the Configuration that will edit in the configuration manager GUI
        Returns:
        the value to saved
        Throws:
        java.lang.Error - if not one of the both method was override
        Since:
        inetcore 4.0
      • applySettings

        @Nonnull
        default java.util.Map<java.lang.String,​java.lang.String> applySettings​(@Nonnull
                                                                                     java.util.Map<java.lang.String,​java.lang.String> clientProperties,
                                                                                     @Nonnull
                                                                                     Configuration config,
                                                                                     @Nonnull
                                                                                     java.util.List<java.util.Map<java.lang.String,​java.lang.String>> originalInConfig)
        Convert the properties from the GUI to the properties that should be saved. Typical this is a filter only.
        Parameters:
        clientProperties - properties from the GUI
        config - the Configuration that will edit in the configuration manager GUI
        originalInConfig - the parsed, read only login settings in configuration
        Returns:
        the value to saved
        Since:
        22.10
      • transformGuiProperties

        default void transformGuiProperties​(@Nonnull
                                            java.util.Map<java.lang.String,​java.lang.Object> properties)
        Transform the loaded values to the format needed for the configuration GUI
        Parameters:
        properties - the loaded properties
        Since:
        inetcore 5.0
      • isMultipleDescriptionSupported

        default boolean isMultipleDescriptionSupported()
        Returns if the provider supports multiple AuthenticationDescription.
        Returns:
        true, if this provider supports multiple logins with different configuration
        Since:
        inetcore 4.0
      • hasAdditionalConfigurationAction

        default boolean hasAdditionalConfigurationAction()
        Returns true, if the provider has an additional configuration page when adding the provider to the list of available login provider. Default is true: providers should have an additional configuration page by default
        Returns:
        true, if the provider has an additional configuration page
        Since:
        21.10