<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
    {% if error %}
    <cas:authenticationFailure code="{{ error.code }}">
        {{ error.msg }}
    </cas:authenticationFailure>
    {% elif ticket %}
    <cas:authenticationSuccess>
        <cas:user>{{ ticket.user.username }}</cas:user>
        {% include 'mama_cas/attributes-jasig.xml' %}
        {% if pgt %}
        <cas:proxyGrantingTicket>{{ pgt }}</cas:proxyGrantingTicket>
        {% endif %}
        {% if proxies %}
        <cas:proxies>
        {% for proxy in proxies %}
            <cas:proxy>{{ proxy }}</cas:proxy>
        {% endfor %}
        </cas:proxies>
        {% endif %}
    </cas:authenticationSuccess>
    {% endif %}
</cas:serviceResponse>
