grafana/SOURCES/001-login-oauth-use-oauth2-exchange.patch

14 lines
561 B
Diff
Raw Normal View History

2019-08-02 15:49:55 +00:00
diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go
2020-01-21 21:32:41 +00:00
index a46c97238..76fc8480c 100644
2019-08-02 15:49:55 +00:00
--- a/pkg/api/login_oauth.go
+++ b/pkg/api/login_oauth.go
@@ -125,7 +125,7 @@ func (hs *HTTPServer) OAuthLogin(ctx *m.ReqContext) {
oauthCtx := context.WithValue(context.Background(), oauth2.HTTPClient, oauthClient)
// get token from provider
- token, err := connect.Exchange(oauthCtx, code)
+ token, err := connect.Exchange(oauthCtx, code, oauth2.AccessTypeOnline)
if err != nil {
ctx.Handle(500, "login.OAuthLogin(NewTransportWithCode)", err)
return