Parcourir la source

added explicitly setting token as Bearer Type

Tom Kozlowski il y a 9 ans
Parent
commit
a353c8d1bb
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      pkg/api/login_oauth.go

+ 3 - 1
pkg/api/login_oauth.go

@@ -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")