From c3a4a76d43bbbda1e762961a0a04b56121ecd4fd Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 2 Jan 2020 16:06:32 +0100 Subject: [PATCH] providers/app_gw: fix Client's response_type not being set --- passbook/providers/app_gw/forms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/passbook/providers/app_gw/forms.py b/passbook/providers/app_gw/forms.py index 6678a6bbf..cac988948 100644 --- a/passbook/providers/app_gw/forms.py +++ b/passbook/providers/app_gw/forms.py @@ -1,7 +1,7 @@ """passbook Application Security Gateway Forms""" from django import forms from oauth2_provider.generators import generate_client_id, generate_client_secret -from oidc_provider.models import Client +from oidc_provider.models import Client, ResponseType from passbook.providers.app_gw.models import ApplicationGatewayProvider @@ -16,6 +16,9 @@ class ApplicationGatewayProviderForm(forms.ModelForm): client_id=generate_client_id(), client_secret=generate_client_secret() ) self.instance.client.name = self.instance.name + self.instance.client.response_types = ResponseType.objects.get_by_natural_key( + "code" + ) self.instance.client.redirect_uris = [ f"http://{self.instance.host}/oauth2/callback", f"https://{self.instance.host}/oauth2/callback",