{% extends change_form_template|default:"admin/cms/page/plugin/change_form.html" %}
{% load i18n %}

{% block content %}
    <p>
        {% if adminform.form.instance.can_login %}
            {% blocktranslate trimmed %}
                This plugin is used to log in a user through authentication with an identity provider.
                If you only want to handover data from the identity provider, but not log in the user, use the "OIDC Handover data".
                Caution! If the plugin creates new users! If you do not want to create them, check the "No new user" radio button.
                When this switch is checked, the plugin pairs the identity from the provider with the logged in user.
            {% endblocktranslate %}
        {% else %}
            {% blocktranslate trimmed %}
                This plugin is only used to handover data from the identity provider.
                Use the "OIDC Login" plugin to log users in.
            {% endblocktranslate %}
        {% endif %}
    </p>
    {{ block.super }}
    <h4>{% translate "Claims example:" %}</h4>
    <pre>
{
    "userinfo": {
        "openid2_id": {"essential": true},
        "preferred_username": {"essential": false},
        "updated_at": {"essential": false},

        "name": {"essential": false},
        "given_name": {"essential": true},
        "family_name": {"essential": true},
        "middle_name": {"essential": false},
        "nickname": {"essential": false},
        "address": {"essential": true},
        "birthdate": {"essential": false},
        "profile": {"essential": false},
        "locale": {"essential": false},
        "picture": {"essential": false},
        "gender": {"essential": false},
        "sub": {"essential": false},
        "zoneinfo": {"essential": false},

        "email": {"essential": true},
        "email_verified": {"essential": true},
        "phone_number": {"essential": true},
        "phone_number_verified": {"essential": true},
        "website": {"essential": false},

        "mojeid_valid": {"essential": true},
    },
    "debug_response": true
}
    </pre>
    <p>
        Attention! The <code>mojeid_valid</code> attribute is only passed to a consumer with
        <a href="https://www.mojeid.cz/documentation/singlehtml/index.html#term-Full-access" target="_blank">full access</a>
        (see <i>Flag – validation</i> in <strong>Other data</strong> in
        <a href="https://www.mojeid.cz/documentation/singlehtml/index.html#appendix-1-list-of-data-to-be-handed-over-openid-connect" target="_blank">List of Data to be Handed Over</a>).
    </p>
    <h4>{% translate "Verified by names:" %}</h4>
    <pre>name given_name+family_name preferred_username nickname email openid2_id</pre>
    <p>
        {% blocktranslate trimmed %}
            The list of names is scrolled in the specified order until the value is found.
            For names composed of a plus sign, the value consist of them.
        {% endblocktranslate %}
    </p>
{% endblock %}