public class CertificateAuthenticator extends Authenticator
getPrincipals(List)
and getUser(Principal)
can be
overridden to change the default behavior.Constructor and Description |
---|
CertificateAuthenticator(Context context) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
authenticate(Request request,
Response response)
Authenticates the call using the X.509 client certificate.
|
protected java.util.List<java.security.Principal> |
getPrincipals(java.util.List<java.security.cert.Certificate> certificateChain)
Extracts the Principal of the subject to use from a chain of certificate.
|
protected User |
getUser(java.security.Principal principal)
Creates a new User based on the subject's X500Principal.
|
authenticated, beforeHandle, getEnroler, isMultiAuthenticating, isOptional, setEnroler, setMultiAuthenticating, setOptional, unauthenticated
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public CertificateAuthenticator(Context context)
context
- protected java.util.List<java.security.Principal> getPrincipals(java.util.List<java.security.cert.Certificate> certificateChain)
certificateChain
- chain of client certificates.X509Certificate
,
X500Principal
protected User getUser(java.security.Principal principal)
principal
- subject's Principal (most likely X500Principal).protected boolean authenticate(Request request, Response response)
getPrincipals(List)
to the request's
ClientInfo and set the user to the result of getUser(Principal)
if that user is non-null.
If no client certificate is available, then a 401 status is set.authenticate
in class Authenticator
request
- The request sent.response
- The response to update.Copyright © 2005-2024 Restlet.