<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>IDP</title>
</head>

<body>
    <p>-- @ Identity Provider --</p>
    {% if request.user.is_authenticated %}
        <p>LOGGED IN - <a href={{ logout_url }}>LOGOUT</a></p>
        <ul>
        {% for k, v in user_attrs %}
            <li>{{k}}: {{v}}</li>
        {% endfor %}
        </ul>

        {% for sp_id in known_sp_ids %}
            <p><a href="{% url 'djangosaml2idp:saml_idp_init' %}?sp={{sp_id|urlencode:""}}&RelayState=%2F">Perform IdP-initiated login to {{sp_id}}</a>></p>
        {% endfor %}
    {% else %}
        <p>LOGGED OUT - <a href={{ login_url }}>LOGIN</a></p>
    {% endif %}

</body>

</html>