KeyError: 'grant_types_supported'
LindezaGrey opened this issue · 1 comments
Hi there,
i am using Authelia as an OpenID Connect Provider. The openid_configuration_endpoint response does not inlcude the key "grant_types_supported" so the check
httpx-oauth/httpx_oauth/clients/openid.py
Line 32 in ab3d701
fails and causes a crash. Since this line is only used for a optional feature later on:
httpx-oauth/httpx_oauth/clients/openid.py
Line 40 in ab3d701
i would suggest to access the openid_configuration in a safer way like so:
refresh_token_supported = "refresh_token" in self.openid_configuration.get(
"grant_types_supported", []
)
instead of
refresh_token_supported = (
"refresh_token" in self.openid_configuration["grant_types_supported"]
)
I am by no means an expert on OAuth, so what is your opinion on this? Is this a legit issue? If not then maybe we could raise a more explicit error instead.
I had a look at the OpenID Discovery specification, and it seems indeed that grant_types_supported
is not required.
What you suggest seems indeed a good solution. Would be happy to review a PR with this change.