From 0caab263109cfa3a70d83b979c009372420c6a86 Mon Sep 17 00:00:00 2001 From: Sam Batschelet Date: Sat, 10 Jun 2017 11:58:39 -0400 Subject: [PATCH] auth: support "authorization" token for grpc-gateway --- auth/store.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/auth/store.go b/auth/store.go index f3cbd6bba17..fb5e74c1df1 100644 --- a/auth/store.go +++ b/auth/store.go @@ -1000,8 +1000,12 @@ func (as *authStore) AuthInfoFromCtx(ctx context.Context) (*AuthInfo, error) { return nil, nil } - ts, tok := md["token"] - if !tok { + //TODO(mitake|hexfusion) review unifying key names + ts, ok := md["token"] + if !ok { + ts, ok = md["authorization"] + } + if !ok { return nil, nil } @@ -1011,6 +1015,7 @@ func (as *authStore) AuthInfoFromCtx(ctx context.Context) (*AuthInfo, error) { plog.Warningf("invalid auth token: %s", token) return nil, ErrInvalidAuthToken } + return authInfo, nil }