Package com.inet.authentication
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
Modifier and TypeMethodDescriptionapplySettings
(@Nonnull Map<String, String> clientProperties, @Nonnull Configuration config, @Nonnull List<Map<String, String>> originalInConfig) Convert the properties from the GUI to the properties that should be saved.@Nonnull LoginProcessor
create
(@Nonnull AuthenticationDescription description) Create an instance of LoginProcessor for the given description.@Nullable LoginProcessor
createLoginProcessor
(@Nonnull AuthenticationDescription description, @Nullable String authorization, javax.servlet.http.HttpServletRequest request, boolean isApplication) Create an instance of a LoginProcessor if possible.@Nullable AuthenticationDescription
getAuthenticationDescription
(@Nonnull Map<String, String> settings, boolean isApplication, boolean isProxy) Get the AuthenticationDescription for the given configuration settings and logging@Nonnull String
getDisplayName
(@Nullable Map<String, String> settings) Get the display name for the GUI.int
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
Returns true, if the provider has an additional configuration page when adding the provider to the list of available login provider.default boolean
Returns if the provider supports multiple AuthenticationDescription.@Nonnull String
name()
The unique name of this provider.default void
transformGuiProperties
(@Nonnull Map<String, Object> properties) Transform the loaded values to the format needed for the configuration GUI
-
Method Details
-
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
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 @Nullable LoginProcessor createLoginProcessor(@Nonnull @Nonnull AuthenticationDescription description, @Nullable @Nullable 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 loginauthorization
- the current HTTP Authorization headerrequest
- current requestisApplication
- true, if the request come NOT from a browser.- Returns:
- a LoginProcessor
- Since:
- inetcore 3.2
-
getDisplayName
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 @Nullable AuthenticationDescription getAuthenticationDescription(@Nonnull @Nonnull Map<String, String> settings, boolean isApplication, boolean isProxy) Get the AuthenticationDescription for the given configuration settings and logging- Parameters:
settings
- the settings in the configuration managerisApplication
- if the call was make from an applicationisProxy
- 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
@Nonnull @Nonnull Map<String,String> applySettings(@Nonnull @Nonnull Map<String, String> clientProperties, @Nonnull @Nonnull Configuration config, @Nonnull @Nonnull List<Map<String, 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 GUIconfig
- the Configuration that will edit in the configuration manager GUIoriginalInConfig
- the parsed, read only login settings in configuration- Returns:
- the value to saved
- Since:
- 22.10
-
transformGuiProperties
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
-