Merge pull request #6584 from tomkozlowski/bugfix/oauth-login-bearer-token

explicitly set oauth2 token to Bearer Type
This commit is contained in:
Dan Cech 2016-11-16 10:35:32 -05:00 committed by GitHub
commit eacb7c8aba

View File

@ -96,7 +96,7 @@ func OAuthLogin(ctx *middleware.Context) {
}
sslcli := &http.Client{Transport: tr}
oauthCtx = context.TODO()
oauthCtx = context.Background()
oauthCtx = context.WithValue(oauthCtx, oauth2.HTTPClient, sslcli)
}
@ -106,6 +106,8 @@ func OAuthLogin(ctx *middleware.Context) {
ctx.Handle(500, "login.OAuthLogin(NewTransportWithCode)", err)
return
}
// token.TokenType was defaulting to "bearer", which is out of spec, so we explicitly set to "Bearer"
token.TokenType = "Bearer"
ctx.Logger.Debug("OAuthLogin Got token")