Skip to content

Commit 17bba2c

Browse files
committed
Bugfix: clean up the None value parameters when needed
1 parent 7bec95b commit 17bba2c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

msal/oauth2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def authorization_url(self,
5151
'state': state,
5252
}
5353
params.update(kwargs)
54+
params = {k: v for k, v in params.items() if v is not None} # clean up
5455
return "%s%s%s" % (self.authorization_endpoint, sep, urlencode(params))
5556

5657
def get_token(
@@ -64,6 +65,7 @@ def get_token(
6465
'client_id': self.client_id, 'grant_type': grant_type,
6566
'scope': scope}
6667
data.update(kwargs)
68+
# We don't need to clean up None values here, because requests lib will.
6769

6870
# Quoted from https://tools.ietf.org/html/rfc6749#section-2.3.1
6971
# Clients in possession of a client password MAY use the HTTP Basic

0 commit comments

Comments
 (0)