public class SSLContextGrpcAuthenticationReader extends Object implements GrpcAuthenticationReader
GrpcAuthenticationReader that will try to use the peer certificates to extract the client
Authentication. Currently this class only supports X509Certificates.| Constructor and Description |
|---|
SSLContextGrpcAuthenticationReader() |
| Modifier and Type | Method and Description |
|---|---|
protected Authentication |
fromCertificate(Certificate cert)
Tries to prepare an
Authentication using the given certificate. |
Authentication |
readAuthentication(io.grpc.ServerCall<?,?> call,
io.grpc.Metadata metadata)
Tries to read the
Authentication information from the given call and metadata. |
public Authentication readAuthentication(io.grpc.ServerCall<?,?> call, io.grpc.Metadata metadata)
GrpcAuthenticationReaderAuthentication information from the given call and metadata.
Note: Implementations are free to throw an AuthenticationException if no credentials could be
found in the call. If an exception is thrown by an implementation then the authentication attempt should be
considered as failed and no subsequent GrpcAuthenticationReaders should be called. Additionally, the call
will fail as Status.UNAUTHENTICATED. If the call instead returns null, then the call processing
will proceed unauthenticated.
readAuthentication in interface GrpcAuthenticationReadercall - The call to get that send the request.metadata - The metadata/headers as sent by the client.@Nullable protected Authentication fromCertificate(Certificate cert)
Authentication using the given certificate.cert - The certificate to use.