google-auth-library-python-oauthlib icon indicating copy to clipboard operation
google-auth-library-python-oauthlib copied to clipboard

InstalledAppFlow.run_local_server does not raise expected error on timeout

Open juhhov opened this issue 2 years ago • 0 comments

Environment details

  • OS type and version: Ubuntu 20.04
  • Python version: Python 3.10.10
  • pip version: pip 23.0.1
  • google-auth-oauthlib version: Version: 1.0.0

Steps to reproduce

  1. Start authentication flow using InstalledAppFlow
  2. Once browser is opened do not proceed but close browser
  3. Wait for timeout to trigger
  4. AttributeError: 'NoneType' object has no attribute 'replace' is raised instead of expected timeout specific error

Code example

flow = InstalledAppFlow.from_client_secrets_file(
    client_secrets_file=client_secret_file,
    scopes=['https://www.googleapis.com/auth/userinfo.email', 'openid', 'https://www.googleapis.com/auth/userinfo.profile'])
return flow.run_local_server(
    host='localhost',
    port=port,
    authorization_prompt_message='Please visit this URL: {url}',
    success_message='The auth flow is complete; you may close this window.',
    open_browser=True,
    timeout_seconds=20)

juhhov avatar Apr 06 '23 09:04 juhhov