Skip to content

Commit

Permalink
Encode scope when building authorization URI
Browse files Browse the repository at this point in the history
When we supply multiple scopes, we end up with a space between the
scopes, which isn't a valid URI.

To fix this, we can include the scope param in the list of params to
encode when building the URI.
  • Loading branch information
jgayfer committed Dec 29, 2021
1 parent 19340d8 commit 0ac41f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aiogoogle/auth/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,10 @@ def authorization_url(
scopes = " ".join(scopes or client_creds["scopes"])
uri = (
self["authorization_endpoint"]
+ f'?redirect_uri={client_creds["redirect_uri"]}&scope={scopes}&'
+ f'?redirect_uri={client_creds["redirect_uri"]}&'
)
for param_name, param in {
"scope": scopes,
"client_id": client_creds["client_id"],
"response_type": response_type,
"state": state,
Expand Down

0 comments on commit 0ac41f8

Please sign in to comment.