Class HttpBasicAuthenticationExtractor

java.lang.Object
org.springframework.grpc.server.security.HttpBasicAuthenticationExtractor
All Implemented Interfaces:
GrpcAuthenticationExtractor

public class HttpBasicAuthenticationExtractor extends Object implements GrpcAuthenticationExtractor
Extracts the HTTP Basic authentication credentials from the gRPC request headers. If the 'Authorization' header is present and starts with 'Basic ', the username and password are extracted from the Base64-encoded header value and returned as a UsernamePasswordAuthenticationToken. If the header is not present or does not start with 'Basic ', this method returns null.
Author:
Dave Syer
  • Constructor Details

    • HttpBasicAuthenticationExtractor

      public HttpBasicAuthenticationExtractor()
  • Method Details

    • extract

      public @Nullable org.springframework.security.core.Authentication extract(io.grpc.Metadata headers, io.grpc.Attributes attributes, io.grpc.MethodDescriptor<?,?> method)
      Specified by:
      extract in interface GrpcAuthenticationExtractor