public class CompositeGrpcAuthenticationReader extends Object implements GrpcAuthenticationReader
GrpcAuthenticationReader
into a single one. The interceptors will be executed in the same
order the are passed to the constructor. The authentication is aborted if a grpc authentication reader throws an
exception.Constructor and Description |
---|
CompositeGrpcAuthenticationReader(List<GrpcAuthenticationReader> authenticationReaders)
Creates a new CompositeGrpcAuthenticationReader with the given authentication readers.
|
Modifier and Type | Method and Description |
---|---|
Authentication |
readAuthentication(ServerCall<?,?> call,
Metadata headers)
Tries to read the
Authentication information from the given call and metadata. |
public CompositeGrpcAuthenticationReader(List<GrpcAuthenticationReader> authenticationReaders)
authenticationReaders
- The authentication readers to use.public Authentication readAuthentication(ServerCall<?,?> call, Metadata headers) throws AuthenticationException
GrpcAuthenticationReader
Authentication
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 GrpcAuthenticationReader
s should be called.
readAuthentication
in interface GrpcAuthenticationReader
call
- The call to get that send the request.headers
- The metadata/headers as sent by the client.AuthenticationException
- If the authentication details are malformed or incomplete and thus the
authentication attempt should be aborted.