python3: oidc authn backend jwk encoding
This commit is contained in:
parent
0e923ba857
commit
b4ae98963d
|
@ -47,7 +47,8 @@ class OIDCBackend(ModelBackend):
|
|||
key = list(key['keys'])[0]
|
||||
algs = ['RS256', 'RS384', 'RS512']
|
||||
elif provider.idtoken_algo == models.OIDCProvider.ALGO_HMAC:
|
||||
key = JWK(kty='oct', k=base64url_encode(provider.client_secret.encode('utf-8')))
|
||||
k = base64url_encode(provider.client_secret.encode('utf-8'))
|
||||
key = JWK(kty='oct', k=k.decode('ascii'))
|
||||
if not provider.client_secret:
|
||||
logger.warning('auth_oidc: idtoken signature algorithm is HMAC but '
|
||||
'no client_secret is defined on provider %s', id_token.iss)
|
||||
|
|
Loading…
Reference in New Issue