Top Description Inners Fields Methods
org.eclipse.jetty.security

public Interface Authenticator

Known Direct Implementers
org.eclipse.jetty.security.Authenticator.NoOp, org.eclipse.jetty.security.authentication.LoginAuthenticator
Imports
java.util.Set, java.util.function.Function, org.eclipse.jetty.security.AuthenticationState.Succeeded, org.eclipse.jetty.server.Context, .Request, .Response, .Server, .Session, org.eclipse.jetty.util.Callback

Authenticator Interface

An Authenticator is responsible for checking requests and sending response challenges in order to authenticate a request. Various types of AuthenticationState are returned in order to signal the next step in authentication.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Authenticator.Configuration

Authenticator Configuration

public static interface
Authenticator.Factory

Authenticator Factory

public static class

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String

Method Summary

Modifier and TypeMethod and Description
public String
getAuthenticationType()

Returns: The name of the authentication type

public default Constraint.Authorization

Returns:

The Constraint.Authorization to apply.
getConstraintAuthentication
(String
The pathInContext to potentially constrain.
pathInContext
,
Constraint.Authorization
The existing authentication constraint for the pathInContext determined independently of Authenticator
existing
,
Function<Boolean, Session>
Function to get or create a Session.
getSession
)

Get an Constraint.Authorization applicable to the path for this authenticator.

public default Request
prepareRequest(Request
the request to prepare for handling
request
,
AuthenticationState
The authentication for the request
authenticationState
)

Called after validateRequest(Request, Response, Callback) and before calling org.eclipse.jetty.server.Handler#handle(Request, Response, Callback) of the nested handler.

public void
setConfiguration(Authenticator.Configuration
the configuration
configuration
)

Configure the Authenticator

public AuthenticationState

Returns:

An Authentication. If Authentication is successful, this will be a Succeeded. If a response has been sent by the Authenticator (which can be done for both successful and unsuccessful authentications), then the result will implement AuthenticationState.ResponseSent.
validateRequest
(Request
The request
request
,
Response
The response
response
,
Callback
the callback to use for writing a response
callback
)

Validate a request

Field Detail

BASIC_AUTHback to summary
public static final String BASIC_AUTH
CERT_AUTHback to summary
public static final String CERT_AUTH
CERT_AUTH2back to summary
public static final String CERT_AUTH2
DIGEST_AUTHback to summary
public static final String DIGEST_AUTH
FORM_AUTHback to summary
public static final String FORM_AUTH
NEGOTIATE_AUTHback to summary
public static final String NEGOTIATE_AUTH
OPENID_AUTHback to summary
public static final String OPENID_AUTH
SPNEGO_AUTHback to summary
public static final String SPNEGO_AUTH

Method Detail

getAuthenticationTypeback to summary
public String getAuthenticationType()
Returns:String

The name of the authentication type

getConstraintAuthenticationback to summary
public default Constraint.Authorization getConstraintAuthentication(String pathInContext, Constraint.Authorization existing, Function<Boolean, Session> getSession)

Get an Constraint.Authorization applicable to the path for this authenticator. This is typically used to vary protection on special URIs known to a specific Authenticator (e.g. /j_security_check for the org.eclipse.jetty.security.authentication.FormAuthenticator.

Parameters
pathInContext:String

The pathInContext to potentially constrain.

existing:Constraint.Authorization

The existing authentication constraint for the pathInContext determined independently of Authenticator

getSession:Function<Boolean, Session>

Function to get or create a Session.

Returns:Constraint.Authorization

The Constraint.Authorization to apply.

prepareRequestback to summary
public default Request prepareRequest(Request request, AuthenticationState authenticationState)

Called after validateRequest(Request, Response, Callback) and before calling org.eclipse.jetty.server.Handler#handle(Request, Response, Callback) of the nested handler. This may be used by an Authenticator to restore method or content from a previous request that was challenged.

Parameters
request:Request

the request to prepare for handling

authenticationState:AuthenticationState

The authentication for the request

setConfigurationback to summary
public void setConfiguration(Authenticator.Configuration configuration)

Configure the Authenticator

Parameters
configuration:Authenticator.Configuration

the configuration

validateRequestback to summary
public AuthenticationState validateRequest(Request request, Response response, Callback callback) throws ServerAuthException

Validate a request

Parameters
request:Request

The request

response:Response

The response

callback:Callback

the callback to use for writing a response

Returns:AuthenticationState

An Authentication. If Authentication is successful, this will be a Succeeded. If a response has been sent by the Authenticator (which can be done for both successful and unsuccessful authentications), then the result will implement AuthenticationState.ResponseSent.

Exceptions
ServerAuthException:
if unable to validate request
org.eclipse.jetty.security back to summary

public Interface Authenticator.Configuration

Known Direct Implementers
org.eclipse.jetty.security.Authenticator.Configuration.Wrapper, org.eclipse.jetty.security.SecurityHandler

Authenticator Configuration

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Method Summary

Modifier and TypeMethod and Description
public String
public IdentityService
public LoginService
public String

Returns:

Parameter value or null
getParameter
(String
parameter name
param
)

Get a SecurityHandler init parameter

public Set<String>

Returns:

Set of parameter names
getParameterNames
()

Get a SecurityHandler init parameter names

public String
public int

Returns:

An interval in seconds; or 0 to not set the interval on authentication; or a negative number to make the session never timeout after authentication.
getSessionMaxInactiveIntervalOnAuthentication
()

Get the interval in seconds, which if non-zero, will be set with Session#setMaxInactiveInterval(int) when a session is newly authenticated

public boolean

Returns:

true if the session ID should be renewed on authentication
isSessionRenewedOnAuthentication
()

Should session ID be renewed on authentication.

Method Detail

getAuthenticationTypeback to summary
public String getAuthenticationType()
getIdentityServiceback to summary
public IdentityService getIdentityService()
getLoginServiceback to summary
public LoginService getLoginService()
getParameterback to summary
public String getParameter(String param)

Get a SecurityHandler init parameter

Parameters
param:String

parameter name

Returns:String

Parameter value or null

getParameterNamesback to summary
public Set<String> getParameterNames()

Get a SecurityHandler init parameter names

Returns:Set<String>

Set of parameter names

getRealmNameback to summary
public String getRealmName()
getSessionMaxInactiveIntervalOnAuthenticationback to summary
public int getSessionMaxInactiveIntervalOnAuthentication()

Get the interval in seconds, which if non-zero, will be set with Session#setMaxInactiveInterval(int) when a session is newly authenticated

Returns:int

An interval in seconds; or 0 to not set the interval on authentication; or a negative number to make the session never timeout after authentication.

isSessionRenewedOnAuthenticationback to summary
public boolean isSessionRenewedOnAuthentication()

Should session ID be renewed on authentication.

Returns:boolean

true if the session ID should be renewed on authentication

org.eclipse.jetty.security back to summary

public Class Authenticator.Configuration.Wrapper

extends Object
implements Configuration
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.security.Authenticator.Configuration.Wrapper
All Implemented Interfaces
org.eclipse.jetty.security.Authenticator.Configuration

Field Summary

Modifier and TypeField and Description
private final Authenticator.Configuration

Constructor Summary

AccessConstructor and Description
public

Field Detail

_configurationback to summary
private final Authenticator.Configuration _configuration

Constructor Detail

Wrapperback to summary
public Wrapper(Authenticator.Configuration configuration)

Method Detail

getAuthenticationTypeback to summary
public String getAuthenticationType()

Implements org.eclipse.jetty.security.Authenticator.Configuration.getAuthenticationType.

Annotations
@Override
getIdentityServiceback to summary
public IdentityService getIdentityService()

Implements org.eclipse.jetty.security.Authenticator.Configuration.getIdentityService.

Annotations
@Override
getLoginServiceback to summary
public LoginService getLoginService()

Implements org.eclipse.jetty.security.Authenticator.Configuration.getLoginService.

Annotations
@Override
getParameterback to summary
public String getParameter(String param)

Implements org.eclipse.jetty.security.Authenticator.Configuration.getParameter.

Doc from org.eclipse.jetty.security.Authenticator.Configuration.getParameter.

Get a SecurityHandler init parameter

Parameters
param:String

parameter name

Returns:String

Parameter value or null

Annotations
@Override
getParameterNamesback to summary
public Set<String> getParameterNames()

Implements org.eclipse.jetty.security.Authenticator.Configuration.getParameterNames.

Doc from org.eclipse.jetty.security.Authenticator.Configuration.getParameterNames.

Get a SecurityHandler init parameter names

Returns:Set<String>

Set of parameter names

Annotations
@Override
getRealmNameback to summary
public String getRealmName()

Implements org.eclipse.jetty.security.Authenticator.Configuration.getRealmName.

Annotations
@Override
getSessionMaxInactiveIntervalOnAuthenticationback to summary
public int getSessionMaxInactiveIntervalOnAuthentication()

Implements org.eclipse.jetty.security.Authenticator.Configuration.getSessionMaxInactiveIntervalOnAuthentication.

Doc from org.eclipse.jetty.security.Authenticator.Configuration.getSessionMaxInactiveIntervalOnAuthentication.

Get the interval in seconds, which if non-zero, will be set with Session#setMaxInactiveInterval(int) when a session is newly authenticated

Returns:int

An interval in seconds; or 0 to not set the interval on authentication; or a negative number to make the session never timeout after authentication.

Annotations
@Override
isSessionRenewedOnAuthenticationback to summary
public boolean isSessionRenewedOnAuthentication()

Implements org.eclipse.jetty.security.Authenticator.Configuration.isSessionRenewedOnAuthentication.

Doc from org.eclipse.jetty.security.Authenticator.Configuration.isSessionRenewedOnAuthentication.

Should session ID be renewed on authentication.

Returns:boolean

true if the session ID should be renewed on authentication

Annotations
@Override
org.eclipse.jetty.security back to summary

public Interface Authenticator.Factory

Known Direct Implementers
org.eclipse.jetty.security.DefaultAuthenticatorFactory

Authenticator Factory

Method Summary

Modifier and TypeMethod and Description
public Authenticator
getAuthenticator(Server server, Context context, Authenticator.Configuration configuration)

Method Detail

getAuthenticatorback to summary
public Authenticator getAuthenticator(Server server, Context context, Authenticator.Configuration configuration)
org.eclipse.jetty.security back to summary

public Class Authenticator.NoOp

extends Object
implements Authenticator
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.security.Authenticator

Constructor Summary

AccessConstructor and Description
public
NoOp()

Method Summary

Modifier and TypeMethod and Description
public String
public void
setConfiguration(Authenticator.Configuration
the configuration
configuration
)

Implements org.eclipse.jetty.security.Authenticator.setConfiguration.

Configure the Authenticator

public AuthenticationState
validateRequest(Request
The request
request
,
Response
The response
response
,
Callback
the callback to use for writing a response
callback
)

Implements org.eclipse.jetty.security.Authenticator.validateRequest.

Validate a request

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NoOpback to summary
public NoOp()

Method Detail

getAuthenticationTypeback to summary
public String getAuthenticationType()

Implements org.eclipse.jetty.security.Authenticator.getAuthenticationType.

Returns:String

Doc from org.eclipse.jetty.security.Authenticator.getAuthenticationType.

The name of the authentication type

Annotations
@Override
setConfigurationback to summary
public void setConfiguration(Authenticator.Configuration configuration)

Implements org.eclipse.jetty.security.Authenticator.setConfiguration.

Doc from org.eclipse.jetty.security.Authenticator.setConfiguration.

Configure the Authenticator

Parameters
configuration:Authenticator.Configuration

the configuration

Annotations
@Override
validateRequestback to summary
public AuthenticationState validateRequest(Request request, Response response, Callback callback) throws ServerAuthException

Implements org.eclipse.jetty.security.Authenticator.validateRequest.

Doc from org.eclipse.jetty.security.Authenticator.validateRequest.

Validate a request

Parameters
request:Request

The request

response:Response

The response

callback:Callback

the callback to use for writing a response

Returns:AuthenticationState

An Authentication. If Authentication is successful, this will be a Succeeded. If a response has been sent by the Authenticator (which can be done for both successful and unsuccessful authentications), then the result will implement AuthenticationState.ResponseSent.

Annotations
@Override
Exceptions
ServerAuthException:
if unable to validate request