googleapis / google-auth-library-python-oauthlib

Apache License 2.0
186 stars 82 forks source link

Flow.autogenerate_code_verifier does not default to True and flow.code_verifier is None #354

Open Perun108 opened 4 months ago

Perun108 commented 4 months ago

Environment details

Steps to reproduce

  1. Create an instance of Flow from client config:
  2. Generate an authorization url from Flow instance
  3. Try to access code_verifier and it will be None

Code example

client_config = {
        "web": {
                "client_id": YOUR_CLIENT_ID,
                "client_secret": YOUR_CLIENT_SECRET,
                "auth_uri": "https://accounts.google.com/o/oauth2/auth",
                "token_uri": "https://oauth2.googleapis.com/token",
                "redirect_uris": [redirect_uri],
            }
        }

flow = Flow.from_client_config(
            client_config,
            scopes=scopes,
            redirect_uri=redirect_uri)

url, gen_state = flow.authorization_url(prompt="consent select_account", state=state)

>>>flow.code_verifier is None
>>>True

Stack trace

# example

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!