0001-auth_oidc-adapt-to-be-compatible-with-jwcrypto-1.patch
src/authentic2_auth_oidc/models.py | ||
---|---|---|
155 | 155 |
_('Provider signature method is %s yet no jwkset was provided.') |
156 | 156 |
% key_sig_mapping[self.idtoken_algo] |
157 | 157 |
) |
158 | ||
159 |
if not any([key.get('kty', None) == key_sig_mapping[self.idtoken_algo] for key in self.jwkset]): |
|
158 |
# verify that a key is available for the chosen algorithm |
|
159 |
for key in self.jwkset: |
|
160 |
# compatibility with jwcrypto < 1 |
|
161 |
key_type = key.get('kty', None) if isinstance(key, dict) else key.key_type |
|
162 |
if key_type == key_sig_mapping[self.idtoken_algo]: |
|
163 |
break |
|
164 |
else: |
|
160 | 165 |
raise ValidationError( |
161 | 166 |
_( |
162 | 167 |
'Provider signature method is %s yet the provided jwkset does not contain any such key type.' |
163 |
- |