diff --git a/flytekit/clients/auth/auth_client.py b/flytekit/clients/auth/auth_client.py index bab4a011dc..8001bf8885 100644 --- a/flytekit/clients/auth/auth_client.py +++ b/flytekit/clients/auth/auth_client.py @@ -15,6 +15,7 @@ from multiprocessing import get_context from urllib.parse import urlencode as _urlencode +import click import requests as _requests from .default_html import get_default_success_html @@ -281,7 +282,10 @@ def _request_authorization_code(self): query = _urlencode(self._request_auth_code_params) endpoint = _urlparse.urlunparse((scheme, netloc, path, None, query, None)) logging.debug(f"Requesting authorization code through {endpoint}") - _webbrowser.open_new_tab(endpoint) + + success = _webbrowser.open_new_tab(endpoint) + if not success: + click.secho(f"Please open the following link in your browser to authenticate: {endpoint}") def _credentials_from_response(self, auth_token_resp) -> Credentials: """