Class LoginConfig
- java.lang.Object
-
- org.glassfish.embeddable.web.config.LoginConfig
-
public class LoginConfig extends Object
The class configures the authentication related parameters like, authentication method, form login configuration, if authentication method is form based authentication, the realm name and the realm type. Usage example:FormLoginConfig form = new FormLoginConfig("login.html", "error.html"); LoginConfig loginConfig = new LoginConfig(); loginConfig.setAuthMethod(AuthMethod.FORM); loginConfig.setRealmName("userauth"); loginConfig.setFormLoginConfig(form);
- Author:
- Rajiv Mordani, Amy Roh
- See Also:
SecurityConfig
-
-
Constructor Summary
Constructors Constructor Description LoginConfig()
LoginConfig(AuthMethod authMethod, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthMethod
getAuthMethod()
Gets the auth method for the contextFormLoginConfig
getFormLoginConfig()
Gets the form login config, or null if the authentication scheme is not form based login.String
getRealmName()
Gets the realm name set for the contextvoid
setAuthMethod(AuthMethod authMethod)
Set the authentication scheme to be used for a given contextvoid
setFormLoginConfig(FormLoginConfig flc)
Set the form login configuration, if the authentication method is form based authenticationvoid
setRealmName(String realmName)
Sets the realm name to be used for the contextString
toString()
Returns a formatted string of the state.
-
-
-
Constructor Detail
-
LoginConfig
public LoginConfig()
-
LoginConfig
public LoginConfig(AuthMethod authMethod, String name)
-
-
Method Detail
-
setAuthMethod
public void setAuthMethod(AuthMethod authMethod)
Set the authentication scheme to be used for a given context- Parameters:
authMethod
- one of the supported auth methods as defined in AuthMethod enumeration
-
getAuthMethod
public AuthMethod getAuthMethod()
Gets the auth method for the context- Returns:
- the authmethod for the context
-
setRealmName
public void setRealmName(String realmName)
Sets the realm name to be used for the context- Parameters:
realmName
- the realm name for the context
-
getRealmName
public String getRealmName()
Gets the realm name set for the context- Returns:
- the realm name for the context
-
setFormLoginConfig
public void setFormLoginConfig(FormLoginConfig flc)
Set the form login configuration, if the authentication method is form based authentication- Parameters:
flc
- form login configuration- See Also:
FormLoginConfig
-
getFormLoginConfig
public FormLoginConfig getFormLoginConfig()
Gets the form login config, or null if the authentication scheme is not form based login.- Returns:
- form login configuration
- See Also:
FormLoginConfig
-
-