public class AnonymousAuthenticationReader extends Object implements GrpcAuthenticationReader
| Constructor and Description |
|---|
AnonymousAuthenticationReader(String key)
Creates a new AnonymousAuthenticationReader with the given key and
"anonymousUser" as principal with the
ROLE_ANONYMOUS. |
AnonymousAuthenticationReader(String key,
Object principal,
Collection<? extends GrantedAuthority> authorities)
Creates a new AnonymousAuthenticationReader with the given key,principal and authorities.
|
| Modifier and Type | Method and Description |
|---|---|
Authentication |
readAuthentication(io.grpc.ServerCall<?,?> call,
io.grpc.Metadata headers)
Tries to read the
Authentication information from the given call and metadata. |
public AnonymousAuthenticationReader(String key)
"anonymousUser" as principal with the
ROLE_ANONYMOUS.key - The key to used to identify tokens that were created by this instance.public AnonymousAuthenticationReader(String key, Object principal, Collection<? extends GrantedAuthority> authorities)
key - The key to used to identify tokens that were created by this instance.principal - The principal which will be used to represent anonymous users.authorities - The authority list for anonymous users.public Authentication readAuthentication(io.grpc.ServerCall<?,?> call, io.grpc.Metadata headers)
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.headers - The metadata/headers as sent by the client.