Codebase list google-auth-oauthlib / e45be1c
New upstream release. Debian Janitor 2 years ago
12 changed file(s) with 246 addition(s) and 144 deletion(s). Raw diff Collapse all Expand all
0 Apache License
0
1 Apache License
12 Version 2.0, January 2004
2 https://www.apache.org/licenses/
3 http://www.apache.org/licenses/
34
45 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
56
191192 you may not use this file except in compliance with the License.
192193 You may obtain a copy of the License at
193194
194 https://www.apache.org/licenses/LICENSE-2.0
195 http://www.apache.org/licenses/LICENSE-2.0
195196
196197 Unless required by applicable law or agreed to in writing, software
197198 distributed under the License is distributed on an "AS IS" BASIS,
1515
1616 # Generated by synthtool. DO NOT EDIT!
1717 include README.rst LICENSE
18 recursive-include google *.json *.proto
18 recursive-include google *.json *.proto py.typed
1919 recursive-include tests *
2020 global-exclude *.py[co]
2121 global-exclude __pycache__
2222
2323 # Exclude scripts for samples readmegen
24 prune scripts/readme-gen
24 prune scripts/readme-gen
00 Metadata-Version: 2.1
11 Name: google-auth-oauthlib
2 Version: 0.4.2
2 Version: 0.5.0
33 Summary: Google Authentication Library
44 Home-page: https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib
55 Author: Google Cloud Platform
66 Author-email: jonwayne+google-auth@google.com
77 License: Apache 2.0
8 Description: oauthlib integration for Google Auth
9 ====================================
10
11 |pypi|
12
13 This library provides `oauthlib`_ integration with `google-auth`_.
14
15 .. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=master
16 :target: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib
17 .. |docs| image:: https://readthedocs.org/projects/google-auth-oauthlib/badge/?version=latest
18 :target: https://google-auth-oauthlib.readthedocs.io/en/latest/
19 .. |pypi| image:: https://img.shields.io/pypi/v/google-auth-oauthlib.svg
20 :target: https://pypi.python.org/pypi/google-auth-oauthlib
21
22 .. _oauthlib: https://github.com/idan/oauthlib
23 .. _google-auth: https://github.com/googleapis/google-auth-library-python
24
25 Installing
26 ----------
27
28 You can install using `pip`_::
29
30 $ pip install google-auth-oauthlib
31
32 .. _pip: https://pip.pypa.io/en/stable/
33
34 Documentation
35 -------------
36
37 The latest documentation is available at `google-auth-oauthlib.readthedocs.io`_.
38
39 .. _google-auth-oauthlib.readthedocs.io: http://google-auth-oauthlib.readthedocs.io/
40
41 License
42 -------
43
44 Apache 2.0 - See `the LICENSE`_ for more information.
45
46 .. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/master/LICENSE
47
488 Keywords: google auth oauth client oauthlib
499 Platform: UNKNOWN
5010 Classifier: Programming Language :: Python :: 3
5212 Classifier: Programming Language :: Python :: 3.7
5313 Classifier: Programming Language :: Python :: 3.8
5414 Classifier: Programming Language :: Python :: 3.9
15 Classifier: Programming Language :: Python :: 3.10
5516 Classifier: Development Status :: 3 - Alpha
5617 Classifier: Intended Audience :: Developers
5718 Classifier: License :: OSI Approved :: Apache Software License
6223 Classifier: Topic :: Internet :: WWW/HTTP
6324 Requires-Python: >=3.6
6425 Provides-Extra: tool
26 License-File: LICENSE
27
28 oauthlib integration for Google Auth
29 ====================================
30
31 |pypi|
32
33 This library provides `oauthlib`_ integration with `google-auth`_.
34
35 .. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=main
36 :target: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib
37 .. |docs| image:: https://readthedocs.org/projects/google-auth-oauthlib/badge/?version=latest
38 :target: https://google-auth-oauthlib.readthedocs.io/en/latest/
39 .. |pypi| image:: https://img.shields.io/pypi/v/google-auth-oauthlib.svg
40 :target: https://pypi.python.org/pypi/google-auth-oauthlib
41
42 .. _oauthlib: https://github.com/idan/oauthlib
43 .. _google-auth: https://github.com/googleapis/google-auth-library-python
44
45 Installing
46 ----------
47
48 You can install using `pip`_::
49
50 $ pip install google-auth-oauthlib
51
52 .. _pip: https://pip.pypa.io/en/stable/
53
54 Documentation
55 -------------
56
57 The latest documentation is available at `google-auth-oauthlib.readthedocs.io`_.
58
59 .. _google-auth-oauthlib.readthedocs.io: http://google-auth-oauthlib.readthedocs.io/
60
61 Supported Python Versions
62 -------------------------
63 Python >= 3.6
64
65
66 Unsupported Python Versions
67 ---------------------------
68
69 Python == 2.7, Python == 3.5.
70
71 The last version of this library compatible with Python 2.7 and 3.5 is
72 `google-auth-oauthlib==0.4.1`.
73
74 License
75 -------
76
77 Apache 2.0 - See `the LICENSE`_ for more information.
78
79 .. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/main/LICENSE
80
81
44
55 This library provides `oauthlib`_ integration with `google-auth`_.
66
7 .. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=master
7 .. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=main
88 :target: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib
99 .. |docs| image:: https://readthedocs.org/projects/google-auth-oauthlib/badge/?version=latest
1010 :target: https://google-auth-oauthlib.readthedocs.io/en/latest/
3030
3131 .. _google-auth-oauthlib.readthedocs.io: http://google-auth-oauthlib.readthedocs.io/
3232
33 Supported Python Versions
34 -------------------------
35 Python >= 3.6
36
37
38 Unsupported Python Versions
39 ---------------------------
40
41 Python == 2.7, Python == 3.5.
42
43 The last version of this library compatible with Python 2.7 and 3.5 is
44 `google-auth-oauthlib==0.4.1`.
45
3346 License
3447 -------
3548
3649 Apache 2.0 - See `the LICENSE`_ for more information.
3750
38 .. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/master/LICENSE
51 .. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/main/LICENSE
0 google-auth-oauthlib (0.4.2-2) UNRELEASED; urgency=medium
0 google-auth-oauthlib (0.5.0-1) UNRELEASED; urgency=medium
11
22 * Set upstream metadata fields: Repository, Repository-Browse.
33 * Update standards version to 4.5.1, no changes needed.
4 * New upstream release.
45
5 -- Debian Janitor <janitor@jelmer.uk> Wed, 03 Feb 2021 00:01:33 -0000
6 -- Debian Janitor <janitor@jelmer.uk> Sat, 05 Mar 2022 06:36:36 -0000
67
78 google-auth-oauthlib (0.4.2-1) unstable; urgency=medium
89
1414 """OAuth 2.0 Authorization Flow
1515
1616 This module provides integration with `requests-oauthlib`_ for running the
17 `OAuth 2.0 Authorization Flow`_ and acquiring user credentials.
18
19 Here's an example of using :class:`Flow` with the installed application
20 authorization flow::
21
22 from google_auth_oauthlib.flow import Flow
17 `OAuth 2.0 Authorization Flow`_ and acquiring user credentials. See
18 `Using OAuth 2.0 to Access Google APIs`_ for an overview of OAuth 2.0
19 authorization scenarios Google APIs support.
20
21 Here's an example of using :class:`InstalledAppFlow`::
22
23 from google_auth_oauthlib.flow import InstalledAppFlow
2324
2425 # Create the flow using the client secrets file from the Google API
2526 # Console.
26 flow = Flow.from_client_secrets_file(
27 'path/to/client_secrets.json',
28 scopes=['profile', 'email'],
29 redirect_uri='urn:ietf:wg:oauth:2.0:oob')
30
31 # Tell the user to go to the authorization URL.
32 auth_url, _ = flow.authorization_url(prompt='consent')
33
34 print('Please go to this URL: {}'.format(auth_url))
35
36 # The user will get an authorization code. This code is used to get the
37 # access token.
38 code = input('Enter the authorization code: ')
39 flow.fetch_token(code=code)
27 flow = InstalledAppFlow.from_client_secrets_file(
28 'client_secrets.json',
29 scopes=['profile', 'email'])
30
31 flow.run_local_server()
4032
4133 # You can use flow.credentials, or you can just get a requests session
4234 # using flow.authorized_session.
4335 session = flow.authorized_session()
44 print(session.get('https://www.googleapis.com/userinfo/v2/me').json())
45
46 This particular flow can be handled entirely by using
47 :class:`InstalledAppFlow`.
36
37 profile_info = session.get(
38 'https://www.googleapis.com/userinfo/v2/me').json()
39
40 print(profile_info)
41 # {'name': '...', 'email': '...', ...}
4842
4943 .. _requests-oauthlib: http://requests-oauthlib.readthedocs.io/en/stable/
5044 .. _OAuth 2.0 Authorization Flow:
5145 https://tools.ietf.org/html/rfc6749#section-1.2
46 .. _Using OAuth 2.0 to Access Google APIs:
47 https://developers.google.com/identity/protocols/oauth2
48
5249 """
5350 from base64 import urlsafe_b64encode
5451 import hashlib
5552 import json
5653 import logging
54 import warnings
5755
5856 try:
5957 from secrets import SystemRandom
6664
6765 import google.auth.transport.requests
6866 import google.oauth2.credentials
69 from six.moves import input
7067
7168 import google_auth_oauthlib.helpers
7269
7370
7471 _LOGGER = logging.getLogger(__name__)
72 _OOB_REDIRECT_URIS = [
73 "urn:ietf:wg:oauth:2.0:oob",
74 "urn:ietf:wg:oauth:2.0:oob:auto",
75 "oob",
76 ]
7577
7678
7779 class Flow(object):
8789 from the `Google API Console`_.
8890
8991 .. _client secrets file:
90 https://developers.google.com/identity/protocols/OAuth2WebServer
92 https://developers.google.com/identity/protocols/oauth2/web-server
9193 #creatingcred
9294 .. _Google API Console:
9395 https://console.developers.google.com/apis/credentials
118120 autogenerate_code_verifier (bool): If true, auto-generate a
119121 code_verifier.
120122 .. _client secrets:
121 https://developers.google.com/api-client-library/python/guide
122 /aaa_client_secrets
123 https://github.com/googleapis/google-api-python-client/blob
124 /main/docs/client-secrets.md
123125 """
124126 self.client_type = client_type
125127 """str: The client type, either ``'web'`` or ``'installed'``"""
152154 format.
153155
154156 .. _client secrets:
155 https://developers.google.com/api-client-library/python/guide
156 /aaa_client_secrets
157 https://github.com/googleapis/google-api-python-client/blob/main/docs/client-secrets.md
157158 """
158159 if "web" in client_config:
159160 client_type = "web"
212213
213214 @redirect_uri.setter
214215 def redirect_uri(self, value):
216 if value in _OOB_REDIRECT_URIS:
217 warnings.warn(
218 "'{}' is an OOB redirect URI. The OAuth out-of-band (OOB) flow is deprecated. "
219 "New clients will be unable to use this flow starting on Feb 28, 2022. "
220 "This flow will be deprecated for all clients on Oct 3, 2022. "
221 "Migrate to an alternative flow. "
222 "See https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob".format(
223 value
224 ),
225 DeprecationWarning,
226 )
215227 self.oauth2session.redirect_uri = value
216228
217229 def authorization_url(self, **kwargs):
326338 local development or applications that are installed on a desktop operating
327339 system.
328340
329 This flow has two strategies: The console strategy provided by
330 :meth:`run_console` and the local server strategy provided by
331 :meth:`run_local_server`.
341 This flow uses a local server strategy provided by :meth:`run_local_server`.
332342
333343 Example::
334344
349359 # {'name': '...', 'email': '...', ...}
350360
351361
352 Note that these aren't the only two ways to accomplish the installed
353 application flow, they are just the most common ways. You can use the
362 Note that this isn't the only way to accomplish the installed
363 application flow, just one of the most common. You can use the
354364 :class:`Flow` class to perform the same flow with different methods of
355365 presenting the authorization URL to the user or obtaining the authorization
356366 response, such as using an embedded web view.
357367
358368 .. _Installed Application Authorization Flow:
359 https://developers.google.com/api-client-library/python/auth
360 /installed-app
369 https://github.com/googleapis/google-api-python-client/blob/main/docs/oauth-installed.md
361370 """
362371
363372 _OOB_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob"
383392 ):
384393 """Run the flow using the console strategy.
385394
395 .. deprecated:: 0.5.0
396 Use :meth:`run_local_server` instead.
397
398 The OAuth out-of-band (OOB) flow is deprecated. New clients will be unable to
399 use this flow starting on Feb 28, 2022. This flow will be deprecated
400 for all clients on Oct 3, 2022. Migrate to an alternative flow.
401
402 See https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob"
403
386404 The console strategy instructs the user to open the authorization URL
387405 in their browser. Once the authorization is complete the authorization
388406 server will give the user a code. The user then must copy & paste this
401419 for the user.
402420 """
403421 kwargs.setdefault("prompt", "consent")
422 warnings.warn(
423 "New clients will be unable to use `InstalledAppFlow.run_console` "
424 "starting on Feb 28, 2022. All clients will be unable to use this method starting on Oct 3, 2022. "
425 "Use `InstalledAppFlow.run_local_server` instead. For details on the OOB flow deprecation, "
426 "see https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob",
427 DeprecationWarning,
428 )
404429
405430 self.redirect_uri = self._OOB_REDIRECT_URI
406431
421446 authorization_prompt_message=_DEFAULT_AUTH_PROMPT_MESSAGE,
422447 success_message=_DEFAULT_WEB_SUCCESS_MESSAGE,
423448 open_browser=True,
449 redirect_uri_trailing_slash=True,
424450 **kwargs
425451 ):
426452 """Run the flow using the server strategy.
443469 the authorization flow is complete.
444470 open_browser (bool): Whether or not to open the authorization URL
445471 in the user's browser.
472 redirect_uri_trailing_slash (bool): whether or not to add trailing
473 slash when constructing the redirect_uri. Default value is True.
446474 kwargs: Additional keyword arguments passed through to
447475 :meth:`authorization_url`.
448476
457485 host, port, wsgi_app, handler_class=_WSGIRequestHandler
458486 )
459487
460 self.redirect_uri = "http://{}:{}/".format(host, local_server.server_port)
488 redirect_uri_format = (
489 "http://{}:{}/" if redirect_uri_trailing_slash else "http://{}:{}"
490 )
491 self.redirect_uri = redirect_uri_format.format(host, local_server.server_port)
461492 auth_url, _ = self.authorization_url(**kwargs)
462493
463494 if open_browser:
516547 Returns:
517548 Iterable[bytes]: The response body.
518549 """
519 start_response("200 OK", [("Content-type", "text/plain")])
550 start_response("200 OK", [("Content-type", "text/plain; charset=utf-8")])
520551 self.last_request_uri = wsgiref.util.request_uri(environ)
521552 return [self._success_message.encode("utf-8")]
5050 oauthlib session and the validated client configuration.
5151
5252 .. _client secrets:
53 https://developers.google.com/api-client-library/python/guide
54 /aaa_client_secrets
53 https://github.com/googleapis/google-api-python-client/blob/main/docs/client-secrets.md
5554 """
5655
5756 if "web" in client_config:
8887 oauthlib session and the validated client configuration.
8988
9089 .. _client secrets:
91 https://developers.google.com/api-client-library/python/guide
92 /aaa_client_secrets
90 https://github.com/googleapis/google-api-python-client/blob/main/docs/client-secrets.md
9391 """
9492 with open(client_secrets_file, "r") as json_file:
9593 client_config = json.load(json_file)
00 Metadata-Version: 2.1
11 Name: google-auth-oauthlib
2 Version: 0.4.2
2 Version: 0.5.0
33 Summary: Google Authentication Library
44 Home-page: https://github.com/GoogleCloudPlatform/google-auth-library-python-oauthlib
55 Author: Google Cloud Platform
66 Author-email: jonwayne+google-auth@google.com
77 License: Apache 2.0
8 Description: oauthlib integration for Google Auth
9 ====================================
10
11 |pypi|
12
13 This library provides `oauthlib`_ integration with `google-auth`_.
14
15 .. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=master
16 :target: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib
17 .. |docs| image:: https://readthedocs.org/projects/google-auth-oauthlib/badge/?version=latest
18 :target: https://google-auth-oauthlib.readthedocs.io/en/latest/
19 .. |pypi| image:: https://img.shields.io/pypi/v/google-auth-oauthlib.svg
20 :target: https://pypi.python.org/pypi/google-auth-oauthlib
21
22 .. _oauthlib: https://github.com/idan/oauthlib
23 .. _google-auth: https://github.com/googleapis/google-auth-library-python
24
25 Installing
26 ----------
27
28 You can install using `pip`_::
29
30 $ pip install google-auth-oauthlib
31
32 .. _pip: https://pip.pypa.io/en/stable/
33
34 Documentation
35 -------------
36
37 The latest documentation is available at `google-auth-oauthlib.readthedocs.io`_.
38
39 .. _google-auth-oauthlib.readthedocs.io: http://google-auth-oauthlib.readthedocs.io/
40
41 License
42 -------
43
44 Apache 2.0 - See `the LICENSE`_ for more information.
45
46 .. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/master/LICENSE
47
488 Keywords: google auth oauth client oauthlib
499 Platform: UNKNOWN
5010 Classifier: Programming Language :: Python :: 3
5212 Classifier: Programming Language :: Python :: 3.7
5313 Classifier: Programming Language :: Python :: 3.8
5414 Classifier: Programming Language :: Python :: 3.9
15 Classifier: Programming Language :: Python :: 3.10
5516 Classifier: Development Status :: 3 - Alpha
5617 Classifier: Intended Audience :: Developers
5718 Classifier: License :: OSI Approved :: Apache Software License
6223 Classifier: Topic :: Internet :: WWW/HTTP
6324 Requires-Python: >=3.6
6425 Provides-Extra: tool
26 License-File: LICENSE
27
28 oauthlib integration for Google Auth
29 ====================================
30
31 |pypi|
32
33 This library provides `oauthlib`_ integration with `google-auth`_.
34
35 .. |build| image:: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib.svg?branch=main
36 :target: https://travis-ci.org/googleapis/google-auth-library-python-oauthlib
37 .. |docs| image:: https://readthedocs.org/projects/google-auth-oauthlib/badge/?version=latest
38 :target: https://google-auth-oauthlib.readthedocs.io/en/latest/
39 .. |pypi| image:: https://img.shields.io/pypi/v/google-auth-oauthlib.svg
40 :target: https://pypi.python.org/pypi/google-auth-oauthlib
41
42 .. _oauthlib: https://github.com/idan/oauthlib
43 .. _google-auth: https://github.com/googleapis/google-auth-library-python
44
45 Installing
46 ----------
47
48 You can install using `pip`_::
49
50 $ pip install google-auth-oauthlib
51
52 .. _pip: https://pip.pypa.io/en/stable/
53
54 Documentation
55 -------------
56
57 The latest documentation is available at `google-auth-oauthlib.readthedocs.io`_.
58
59 .. _google-auth-oauthlib.readthedocs.io: http://google-auth-oauthlib.readthedocs.io/
60
61 Supported Python Versions
62 -------------------------
63 Python >= 3.6
64
65
66 Unsupported Python Versions
67 ---------------------------
68
69 Python == 2.7, Python == 3.5.
70
71 The last version of this library compatible with Python 2.7 and 3.5 is
72 `google-auth-oauthlib==0.4.1`.
73
74 License
75 -------
76
77 Apache 2.0 - See `the LICENSE`_ for more information.
78
79 .. _the LICENSE: https://github.com/googleapis/google-auth-library-python-oauthlib/blob/main/LICENSE
80
81
00 [console_scripts]
11 google-oauthlib-tool = google_auth_oauthlib.tool.__main__:main [tool]
2
0 google-auth
0 google-auth>=1.0.0
11 requests-oauthlib>=0.7.0
22
33 [tool]
4 click
4 click>=6.0.0
1717 from setuptools import setup
1818
1919
20 TOOL_DEPENDENCIES = "click"
20 TOOL_DEPENDENCIES = "click>=6.0.0"
2121
22 DEPENDENCIES = ("google-auth", "requests-oauthlib>=0.7.0")
22 DEPENDENCIES = ("google-auth>=1.0.0", "requests-oauthlib>=0.7.0")
2323
2424
2525 with io.open("README.rst", "r") as fh:
2626 long_description = fh.read()
2727
2828
29 version = "0.4.2"
29 version = "0.5.0"
3030
3131 setup(
3232 name="google-auth-oauthlib",
5353 "Programming Language :: Python :: 3.7",
5454 "Programming Language :: Python :: 3.8",
5555 "Programming Language :: Python :: 3.9",
56 "Programming Language :: Python :: 3.10",
5657 "Development Status :: 3 - Alpha",
5758 "Intended Audience :: Developers",
5859 "License :: OSI Approved :: Apache Software License",
2323 import mock
2424 import pytest
2525 import requests
26 from six.moves import urllib
26 import urllib
2727
2828 from google_auth_oauthlib import flow
2929
5555 instance.redirect_uri
5656 == instance.oauth2session.redirect_uri
5757 == mock.sentinel.redirect_uri
58 )
59
60 def test_from_client_secrets_file_with_oob_redirect_uri(self):
61 with pytest.deprecated_call():
62 instance = flow.Flow.from_client_secrets_file(
63 CLIENT_SECRETS_FILE,
64 scopes=mock.sentinel.scopes,
65 redirect_uri="urn:ietf:wg:oauth:2.0:oob",
66 )
67
68 assert (
69 instance.redirect_uri
70 == instance.oauth2session.redirect_uri
71 == "urn:ietf:wg:oauth:2.0:oob"
5872 )
5973
6074 def test_from_client_config_installed(self):
281295 with fetch_token_patch as fetch_token_mock:
282296 yield fetch_token_mock
283297
284 @mock.patch("google_auth_oauthlib.flow.input", autospec=True)
298 @mock.patch("builtins.input", autospec=True)
285299 def test_run_console(self, input_mock, instance, mock_fetch_token):
286300 input_mock.return_value = mock.sentinel.code
287301 instance.code_verifier = "amanaplanacanalpanama"
288 credentials = instance.run_console()
302
303 with pytest.deprecated_call():
304 credentials = instance.run_console()
289305
290306 assert credentials.token == mock.sentinel.access_token
291307 assert credentials._refresh_token == mock.sentinel.refresh_token
320336 assert credentials._refresh_token == mock.sentinel.refresh_token
321337 assert credentials.id_token == mock.sentinel.id_token
322338 assert webbrowser_mock.open.called
339 assert instance.redirect_uri == f"http://localhost:{port}/"
323340
324341 expected_auth_response = auth_redirect_url.replace("http", "https")
325342 mock_fetch_token.assert_called_with(
340357 instance.code_verifier = "amanaplanacanalpanama"
341358
342359 with concurrent.futures.ThreadPoolExecutor(max_workers=1) as pool:
343 future = pool.submit(partial(instance.run_local_server, port=port))
360 future = pool.submit(
361 partial(
362 instance.run_local_server,
363 port=port,
364 redirect_uri_trailing_slash=False,
365 )
366 )
344367
345368 while not future.done():
346369 try:
354377 assert credentials._refresh_token == mock.sentinel.refresh_token
355378 assert credentials.id_token == mock.sentinel.id_token
356379 assert webbrowser_mock.open.called
380 assert instance.redirect_uri == f"http://localhost:{port}"
357381
358382 expected_auth_response = auth_redirect_url.replace("http", "https")
359383 mock_fetch_token.assert_called_with(