We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b5577c commit d987dc0Copy full SHA for d987dc0
djangosaml2/views.py
@@ -323,8 +323,12 @@ def echo_attributes(request,
323
client = Saml2Client(conf, state_cache=state,
324
identity_cache=IdentityCache(request.session))
325
subject_id = _get_subject_id(request.session)
326
- identity = client.users.get_identity(subject_id,
327
- check_not_on_or_after=False)
+ try:
+ identity = client.users.get_identity(subject_id,
328
+ check_not_on_or_after=False)
329
+ except AttributeError:
330
+ return HttpResponse("No active SAML identity found. Are you sure you have logged in via SAML?")
331
+
332
return render(request, template, {'attributes': identity[0]})
333
334
0 commit comments