Skip to content

feat: adds ability to provide redirect uri #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions google_auth_oauthlib/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def run_console(
self,
authorization_prompt_message=_DEFAULT_AUTH_PROMPT_MESSAGE,
authorization_code_message=_DEFAULT_AUTH_CODE_MESSAGE,
redirect_uri=None,
**kwargs
):
"""Run the flow using the console strategy.
Expand Down Expand Up @@ -422,14 +423,21 @@ def run_console(
"""
kwargs.setdefault("prompt", "consent")
warnings.warn(
"New clients will be unable to use `InstalledAppFlow.run_console` "
"starting on Feb 28, 2022. All clients will be unable to use this method starting on Oct 3, 2022. "
"Use `InstalledAppFlow.run_local_server` instead. For details on the OOB flow deprecation, "
"Due to changes Google has put into place to make OAuth flows safer, users should use "
"`InstalledAppFlow.run_local_server` where possible. If your system is running in a highly "
"constrained development environment such that a local server solution will not work "
"you may be able to implement a solution using `.run_console()` by providing a Client ID and "
"Client Secret. For details on how to configure your system to and on authenticating in a highly "
"constrained environment see the following documentation: #TODO add URL to the docs."
"For details on the OOB flow deprecation, "
"see https://developers.googleblog.com/2022/02/making-oauth-flows-safer.html?m=1#disallowed-oob",
DeprecationWarning,
)

self.redirect_uri = self._OOB_REDIRECT_URI
if redirect_uri:
self.redirect_uri = redirect_uri
else:
self.redirect_uri = self._OOB_REDIRECT_URI

auth_url, _ = self.authorization_url(**kwargs)

Expand Down