Skip to content
Snippets Groups Projects
Unverified Commit 97d2c246 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Enhance the test auth source page.

parent 2e2c985c
No related branches found
No related tags found
No related merge requests found
......@@ -12,24 +12,67 @@
{{ attributesHtml|raw }}
{% if nameidHtml -%}
<h2>{{ '{status:subject_header}'|trans }}</h2>
{{ nameidHtml|raw }}
{%- endif %}
{%- if nameid or authData %}
{% if authData -%}
<h2>{% trans %}AuthData{% endtrans %}</h2>
<details><summary>{% trans %}Click to view AuthData{% endtrans %}</summary>
<pre>{{ authData|json_encode|raw }}</pre>
</details>
{%- endif %}
<h2>{% trans %}Technical information{% endtrans %}</h2>
{% endif %}
{%- if nameid %}
{% if logout -%}
<h2>{{ '{status:logout}'|trans }}</h2>
<p>{{ logout }}</p>
{%- endif %}
<h3>{% trans %}SAML Subject{% endtrans %}</h3>
{% set items = {'NameId' : nameid.value} %}
{% if not nameid.value %}
{% set items = items|merge({'NameID' : 'not set'|trans}) %}
{% endif %}
{% if nameid.Format %}
{% set items = items|merge({('Format'|trans) : nameid.Format}) %}
{% endif %}
{% if nameid.NameQualifier %}
{% set items = items|merge({'NameQualifier' : nameid.NameQualifier}) %}
{% endif %}
{% if nameid.SPNameQualifier %}
{% set items = items|merge({'SPNameQualifier' : nameid.SPNameQualifier}) %}
{% endif %}
{% if nameid.SPProvidedID %}
{% set items = items|merge({'SPProvidedID' : nameid.SPProvidedID}) %}
{%- endif %}
<table id="table_with_attributes" class="attributes pure-table pure-table-striped pure-table-attributes"
summary="{% trans %}SAML Subject{% endtrans %}">
{%- for name, value in items %}
<tr class="{{ cycle(['odd', 'even'], loop.index0) }}">
<td class="attrname">{{ name }}</td>
<td class="attrvalue">{{ value }}</td>
</tr>
{%- endfor %}
</table>
<br/>
{% endif %}
{% if authData %}
<h3>{% trans %}Authentication data{% endtrans %}</h3>
<div class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#auth-data"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<code id="auth-data" class="code-box-content json">
{{- authData|json_encode(constant("JSON_PRETTY_PRINT") b-or constant("JSON_UNESCAPED_SLASHES")) }}
</code>
</div>
<br/>
{% endif %}
{%- if logouturl %}
{% if logouturl -%}
<a href="{{ logouturl }}">{{ '{status:logout}'|trans }}</a>
<div class="center">
<a class="pure-button pure-button-red" href="{{ logouturl }}">{{ '{status:logout}'|trans }}</a>
</div>
{%- endif %}
{% endblock %}
......@@ -4,6 +4,7 @@ import "selectize/dist/js/selectize";
import hljs from "highlight.js/lib/highlight";
import xml from "highlight.js/lib/languages/xml";
import php from "highlight.js/lib/languages/php";
import json from "highlight.js/lib/languages/json";
$(document).ready(function () {
// get available languages
......@@ -39,7 +40,8 @@ $(document).ready(function () {
// syntax highlight
hljs.registerLanguage('xml', xml);
hljs.registerLanguage('php', php);
$('.code-box-content.xml, .code-box-content.php').each(function(i, block) {
hljs.registerLanguage('json', json);
$('.code-box-content.xml, .code-box-content.php, .code-box-content.json').each(function(i, block) {
hljs.highlightBlock(block)
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment