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 List<Principal> |
getPrincipals(List<Certificate> certificateChain)
Extracts the Principal of the subject to use from a chain of certificate.
|
protected User |
getUser(Principal principal)
Creates a new User based on the subject's X500Principal.
|
authenticated, beforeHandle, getEnroler, isMultiAuthenticating, isOptional, setEnroler, setMultiAuthenticating, setOptional, unauthenticatedafterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stopcreateFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwnerpublic CertificateAuthenticator(Context context)
context - protected List<Principal> getPrincipals(List<Certificate> certificateChain)
certificateChain - chain of client certificates.X509Certificate,
X500Principalprotected User getUser(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 Authenticatorrequest - The request sent.response - The response to update.Copyright © 2005–2025. All rights reserved.