From 5f8648159db13109a250a70fe011b5fda4e3b0ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 1 Oct 2020 17:09:14 +0200 Subject: [PATCH] Fix handling of HTTP 403 in Device Flow detection --- auth/oauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth/oauth.go b/auth/oauth.go index c5066d588..14ddc12e2 100644 --- a/auth/oauth.go +++ b/auth/oauth.go @@ -69,7 +69,7 @@ func (oa *OAuthFlow) ObtainAccessToken() (accessToken string, err error) { } } - if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusPaymentRequired || + if resp.StatusCode == http.StatusUnauthorized || resp.StatusCode == http.StatusForbidden || resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusUnprocessableEntity || (resp.StatusCode == http.StatusBadRequest && values != nil && values.Get("error") == "unauthorized_client") { // OAuth Device Flow is not available; continue with OAuth browser flow with a