Closed ramchandra-st closed 6 months ago
I do not know under what circumstances the key cannot be found. Though, the above mentioned code has undergone some refactoring, and it now does recognize that scenario:
key = lookup(keys_data, kid)
if not key:
raise OAuth2Error(f"Invalid 'kid': '{kid}'")
So it is now handled as far as we can on our end.
I came across issues, where the
_get_apple_public_key
private method returnsNone
even though it receiveskid
value from the caller. I believe the code from_get_apple_public_key
didn't find thed
fromdata
for the givenkid
(So this means, we don't have a public key for the given kid).So my question is, in what sort of scenarios this issue occurs?
Some code queries from this module: https://github.com/pennersr/django-allauth/blob/main/allauth/socialaccount/providers/apple/views.py#L52C63-L52C63
And caller defintion of above
It handles
jwt.PyJWTError
, butget_public_key
could raiseAttributeError
if we getapple_public_key
isNone
.With
django-allauth==0.55.2