Class JaspiAuthenticatorFactory
java.lang.Object
org.eclipse.jetty.security.DefaultAuthenticatorFactory
org.eclipse.jetty.ee10.security.jaspi.JaspiAuthenticatorFactory
- All Implemented Interfaces:
Authenticator.Factory
Jakarta Authentication (JASPI) Authenticator Factory.
This is used to link a jetty-security
Authenticator.Factory
to a Jakarta Authentication AuthConfigFactory
.
This should be initialized with the provided DefaultAuthConfigFactory
to set up Jakarta Authentication AuthConfigFactory
before use.
(A different AuthConfigFactory
may also be provided using the same steps below)
To initialize either:
- invoke
AuthConfigFactory.setFactory(AuthConfigFactory)
- Alternatively: set
AuthConfigFactory.DEFAULT_FACTORY_SECURITY_PROPERTY
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
findServerName
(Context context, Server server) Find a servername.protected Subject
findServiceSubject
(Server server) Find a service Subject.getAuthenticator
(Server server, Context context, Authenticator.Configuration configuration) Get the serverName.Get the serviceSubject.void
setServerName
(String serverName) Set the serverName to set.void
setServiceSubject
(Subject serviceSubject) Set the serviceSubject to set.
-
Field Details
-
MESSAGE_LAYER
- See Also:
-
-
Constructor Details
-
JaspiAuthenticatorFactory
public JaspiAuthenticatorFactory()
-
-
Method Details
-
getServiceSubject
Get the serviceSubject.- Returns:
- the serviceSubject
-
setServiceSubject
Set the serviceSubject to set.- Parameters:
serviceSubject
- the serviceSubject to set
-
getServerName
Get the serverName.- Returns:
- the serverName
-
setServerName
Set the serverName to set.- Parameters:
serverName
- the serverName to set
-
getAuthenticator
public Authenticator getAuthenticator(Server server, Context context, Authenticator.Configuration configuration) - Specified by:
getAuthenticator
in interfaceAuthenticator.Factory
- Overrides:
getAuthenticator
in classDefaultAuthenticatorFactory
-
findServiceSubject
Find a service Subject. IfsetServiceSubject(Subject)
has not been used to set a subject, then theContainerLifeCycle.getBeans(Class)
method is used to look for a Subject.- Parameters:
server
- the server to pull the Subject from- Returns:
- the subject
-
findServerName
Find a servername. IfsetServerName(String)
has not been called, then use the virtualServerName of the context. If this is also null, then use the name of the a principal in the service subject. If none are found, return "server".- Parameters:
context
- the contextserver
- the server to find the name of- Returns:
- the server name from the service Subject (or default value if not found in subject or principals)
-