|
|
|
@ -127,6 +127,7 @@ func (in *GRPCAuthInterceptor) authenticate(ctx context.Context, accessToken str
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getTokenFromMetadata(md metadata.MD) (string, error) {
|
|
|
|
|
// Check the HTTP request header first.
|
|
|
|
|
authorizationHeaders := md.Get("Authorization")
|
|
|
|
|
if len(md.Get("Authorization")) > 0 {
|
|
|
|
|
authHeaderParts := strings.Fields(authorizationHeaders[0])
|
|
|
|
@ -135,7 +136,7 @@ func getTokenFromMetadata(md metadata.MD) (string, error) {
|
|
|
|
|
}
|
|
|
|
|
return authHeaderParts[1], nil
|
|
|
|
|
}
|
|
|
|
|
// check the HTTP cookie
|
|
|
|
|
// Check the cookie header.
|
|
|
|
|
var accessToken string
|
|
|
|
|
for _, t := range append(md.Get("grpcgateway-cookie"), md.Get("cookie")...) {
|
|
|
|
|
header := http.Header{}
|
|
|
|
|