Skip to content

Commit 32ca4b6

Browse files
committed
Wayf page with fallback value if any display name for idps
1 parent fd6a823 commit 32ca4b6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

djangosaml2/templates/djangosaml2/wayf.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1>Where are you from?</h1>
99
<p>Please select your <strong>Identity Provider</strong> from the following list:</p>
1010
<ul>
1111
{% for url, name in available_idps %}
12-
<li><a href="{% url 'saml2_login' %}?idp={{ url }}{% if came_from %}&next={{ came_from }}{% endif %}">{{ name }}</a></li>
12+
<li><a href="{% url 'saml2_login' %}?idp={{ url }}{% if came_from %}&next={{ came_from }}{% endif %}">{{ name|default_if_none:url }}</a></li>
1313
{% endfor %}
1414
</ul>
1515
</body>

djangosaml2/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ def get_sp_config(self, request: HttpRequest) -> SPConfig:
8282
def get_state_client(self, request: HttpRequest):
8383
conf = self.get_sp_config(request)
8484
state = StateCache(request.saml_session)
85-
client = Saml2Client(conf, state_cache=state, identity_cache=IdentityCache(request.saml_session))
85+
client = Saml2Client(
86+
conf, state_cache=state,
87+
identity_cache=IdentityCache(request.saml_session)
88+
)
8689
return state, client
8790

8891

0 commit comments

Comments
 (0)