The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
BSD 3-Clause "New" or "Revised" License
4.55k
stars
452
forks
source link
New token will not be fetched if grant_type='client_credentials' is passed for fetch_token() #660
Open
bryan-prime opened 3 months ago
Describe the bug
If I pass
client_credentials
as thegrant_type
it will not automatically fetch the new token.To Reproduce
My code where I pass the
grant_type
.https://github.com/lepture/authlib/blob/master/authlib/oauth2/client.py#L199-L204
self.metadata
is only set ifNone
was passed forgrant_type
https://github.com/lepture/authlib/blob/master/authlib/oauth2/client.py#L279-L284
self.metadata['grant_type']
will beNone
so it will not fetch the new token.My workaround was passing nothing for fetch token because it luckily defaults to
client_credentials
if nothing was passed for thegrant_type
.Expected behavior
A clear and concise description of what you expected to happen.
Environment:
Additional context
Add any other context about the problem here.