wc-base-import: add handling of idtoken_algo
This commit is contained in:
parent
df5fb59dc6
commit
504e00fbf3
|
@ -101,6 +101,9 @@ class Command(BaseCommand):
|
|||
assert isinstance(redirect_uris, list)
|
||||
has_api_access = service.get('has_api_access', False)
|
||||
assert isinstance(has_api_access, bool)
|
||||
idtoken_algo = OIDCClient.ALGO_HMAC
|
||||
if 'idtoken_algo' in service:
|
||||
idtoken_algo = getattr(OIDCClient, 'ALGO_' + service['idtoken_algo'].upper())
|
||||
|
||||
oidc_client, created = OIDCClient.objects.get_or_create(slug=service['slug'], ou=ou, defaults={
|
||||
'name': name,
|
||||
|
@ -110,6 +113,7 @@ class Command(BaseCommand):
|
|||
'post_logout_redirect_uris': '\n'.join(post_logout_redirect_uris),
|
||||
'redirect_uris': '\n'.join(redirect_uris),
|
||||
'has_api_access': has_api_access,
|
||||
'idtoken_algo': idtoken_algo,
|
||||
})
|
||||
services[slug] = {
|
||||
'oidc_client': oidc_client,
|
||||
|
@ -118,7 +122,7 @@ class Command(BaseCommand):
|
|||
modified = False
|
||||
for key in ('name', 'client_id', 'client_secret',
|
||||
'frontchannel_logout_uri', 'post_logout_redirect_uris',
|
||||
'redirect_uris', 'has_api_access'):
|
||||
'redirect_uris', 'has_api_access', 'idtoken_algo', 'identifier_policy'):
|
||||
if getattr(oidc_client, key) != locals()[key]:
|
||||
setattr(oidc_client, key, locals()[key])
|
||||
modified = True
|
||||
|
|
Loading…
Reference in New Issue