(resp *http.Response)
| 82 | } |
| 83 | |
| 84 | func tryDecodeOAuthError(resp *http.Response) error { |
| 85 | var body map[string]any |
| 86 | if err := json.NewDecoder(resp.Body).Decode(&body); err == nil { |
| 87 | if errorDescription, ok := body["error_description"].(string); ok { |
| 88 | return errors.New(errorDescription) |
| 89 | } |
| 90 | } |
| 91 | return errors.New("unexpected response from tenant: " + resp.Status) |
| 92 | } |
| 93 | |
| 94 | // WaitForDeviceToken polls the tenant to get access/refresh tokens for the user. |
| 95 | // This should be called after GetDeviceCode, and will block until the user has |
no outgoing calls
no test coverage detected
searching dependent graphs…