diff --git a/src/pretix/control/forms/organizer.py b/src/pretix/control/forms/organizer.py
index 2bafd2d420..eb81cea6b0 100644
--- a/src/pretix/control/forms/organizer.py
+++ b/src/pretix/control/forms/organizer.py
@@ -1198,7 +1198,7 @@ OrganizerFooterLinkFormset = inlineformset_factory(
class SSOProviderForm(I18nModelForm):
config_oidc_base_url = forms.URLField(
- label=pgettext_lazy('sso_oidc', 'Base URL'),
+ label=pgettext_lazy('sso_oidc', 'Base URL / issuer'),
required=False,
)
config_oidc_client_id = forms.CharField(
@@ -1295,6 +1295,14 @@ class SSOProviderForm(I18nModelForm):
class SSOClientForm(I18nModelForm):
+ disp_base_url = forms.CharField(
+ label=_('Base URL / issuer'),
+ disabled=True,
+ )
+ disp_client_id = forms.CharField(
+ label=_('Client ID'),
+ disabled=True,
+ )
regenerate_client_secret = forms.BooleanField(
label=_('Invalidate old client secret and generate a new one'),
required=False,
@@ -1302,7 +1310,8 @@ class SSOClientForm(I18nModelForm):
class Meta:
model = CustomerSSOClient
- fields = ['is_active', 'name', 'client_id', 'client_type', 'authorization_grant_type', 'redirect_uris',
+ fields = ['is_active', 'name', 'disp_base_url', 'disp_client_id', 'regenerate_client_secret',
+ 'client_type', 'authorization_grant_type', 'redirect_uris',
'allowed_scopes', 'require_pkce']
widgets = {
'authorization_grant_type': forms.RadioSelect,
@@ -1317,13 +1326,17 @@ class SSOClientForm(I18nModelForm):
help_text=self.fields['allowed_scopes'].help_text,
required=self.fields['allowed_scopes'].required,
initial=self.fields['allowed_scopes'].initial,
- choices=CustomerSSOClient.SCOPE_CHOICES,
+ choices=[(val, format_html('{} – {}', val, label)) for val, label in CustomerSSOClient.SCOPE_CHOICES],
widget=forms.CheckboxSelectMultiple
)
+ organizer = kwargs['event']
+ self.initial['disp_base_url'] = eventreverse_absolute(organizer, 'presale:organizer.index', {}).strip('/')
if self.instance and self.instance.pk:
- self.fields['client_id'].disabled = True
+ self.initial['disp_client_id'] = self.instance.client_id
+ self.initial['disp_client_secret'] = '****'
else:
- del self.fields['client_id']
+ self.initial['disp_client_id'] = _('(will be generated)')
+ self.initial['disp_client_secret'] = _('(will be generated)')
del self.fields['regenerate_client_secret']
diff --git a/src/pretix/control/templates/pretixcontrol/organizers/ssoclient_edit.html b/src/pretix/control/templates/pretixcontrol/organizers/ssoclient_edit.html
index e1265ced37..aaebd0859f 100644
--- a/src/pretix/control/templates/pretixcontrol/organizers/ssoclient_edit.html
+++ b/src/pretix/control/templates/pretixcontrol/organizers/ssoclient_edit.html
@@ -1,12 +1,29 @@
{% extends "pretixcontrol/organizers/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
+{% block title %}
+ {% if client %}
+ {% trans "SSO client:" %} {{ client.name }}
+ {% else %}
+ {% trans "Create credentials for a new SSO client" %}
+ {% endif %}
+{% endblock %}
{% block inner %}
{% if client %}
+ {% blocktrans trimmed %} + After submitting this form, client credentials for your SSO client will be generated. + {% endblocktrans %} +
{% endif %} ++ {% blocktrans trimmed with url="https://docs.pretix.eu/guides/customer-accounts/#using-pretix-as-an-sso-provider" %} + For more information, refer to our documentation on Using pretix as an SSO provider with external SSO clients. + {% endblocktrans %} +