2024-12-16 17:17:42 +00:00
{# The token edition template.
Displays the details of a token :class:`~canaille.oidc.basemodels.Token`.
:param form: A token revokation form.
:type form: :class:`~canaille.oidc.endpoints.forms.TokenRevokationForm`.
#}
2021-10-28 13:24:34 +00:00
{% extends theme('base.html') %}
2023-03-28 18:37:16 +00:00
{% import 'macro/form.html' as fui %}
2020-08-26 14:27:08 +00:00
2023-03-16 18:30:30 +00:00
{%- block title -%}
{%- trans %}Token details{% endtrans -%}
{%- endblock -%}
2023-03-10 00:02:36 +00:00
2023-02-03 17:43:13 +00:00
{% block script %}
2023-12-25 19:15:21 +00:00
< script src = "{{ url_for(" static " , filename = "js/copy.js" ) } } " defer > < / script >
2023-02-03 17:43:13 +00:00
{% endblock %}
2023-03-15 16:27:32 +00:00
{% block submenu %}
2023-09-08 07:05:51 +00:00
< a class = "item" href = "{{ url_for('core.admin.mail_index') }}" >
< i class = "user mail icon" > < / i >
{% trans %}Emails{% endtrans %}
< / a >
< a class = "item" href = "{{ url_for('oidc.clients.index') }}" >
< i class = "th list icon" > < / i >
{% trans %}Clients{% endtrans %}
< / a >
< a class = "item" href = "{{ url_for('oidc.clients.add') }}" >
< i class = "plus icon" > < / i >
{% trans %}Add a client{% endtrans %}
< / a >
< a class = "active item" href = "{{ url_for('oidc.tokens.index') }}" >
< i class = "key icon" > < / i >
{% trans %}Tokens{% endtrans %}
< / a >
< a class = "item" href = "{{ url_for('oidc.authorizations.index') }}" >
< i class = "user secret icon" > < / i >
{% trans %}Codes{% endtrans %}
< / a >
2023-03-15 16:27:32 +00:00
{% endblock %}
2020-08-26 14:27:08 +00:00
{% block content %}
2021-12-20 22:57:27 +00:00
< div class = "loginform" >
< h3 class = "ui top attached header" >
2023-02-04 17:41:49 +00:00
{% trans %}Token details{% endtrans %}
2021-12-20 22:57:27 +00:00
< / h3 >
2020-10-31 17:22:24 +00:00
2021-12-20 22:57:27 +00:00
< div class = "ui attached clearing segment" >
2023-07-06 16:43:37 +00:00
{% call fui.render_form(form, class_="token-form info") %}
< table class = "ui celled striped table" >
< tr >
< td > {{ _("Client") }}< / td >
< td >
< a href = "{{ url_for(" oidc . clients . edit " , client = token.client) } } " >
{{ token.client.client_name }}
< / a >
< / td >
< / tr >
< tr >
< td > {{ _("Subject") }}< / td >
< td >
2024-12-06 13:43:31 +00:00
{% if token.subject %}
< a href = "{{ url_for(" core . account . profile_edition " , edited_user = token.subject) } } " >
{{ token.subject.identifier }}
< / a >
{% else %}
< a href = "{{ url_for(" oidc . clients . edit " , client = token.client) } } " >
{{ token.client.client_name }}
< / a >
{% endif %}
2023-07-06 16:43:37 +00:00
< / td >
< / tr >
< tr >
< td > {{ _("Scope") }}< / td >
< td >
< ul class = "ui list" >
{% for scope in token.scope %}
< li class = "item" > {{ scope }}< / li >
{% endfor %}
< / ul >
< / td >
< / tr >
< tr >
< td > {{ _("Audience") }}< / td >
< td >
< ul class = "ui list" >
{% for client in token.audience %}
< li class = "item" >
< a href = "{{ url_for(" oidc . clients . edit " , client = client) } } " >
{{ client.client_name }}
< / a >
< / li >
{% endfor %}
< / ul >
< / td >
< / tr >
< tr >
< td > {{ _("Issue date") }}< / td >
2024-12-07 15:06:10 +00:00
< td > {{ token.issue_date|datetimeformat }}< / td >
2023-07-06 16:43:37 +00:00
< / tr >
< tr >
< td > {{ _("Expiration date") }}< / td >
2024-12-07 15:06:10 +00:00
< td >
{{ token.expire_date|datetimeformat }}
{% if token.is_expired() %}
< a class = "item" >
< div class = "ui red horizontal label" > {% trans %}This token has expired.{% endtrans %}< / div >
< / a >
{% endif %}
< / td >
2023-07-06 16:43:37 +00:00
< / tr >
< tr >
< td > {{ _("Revokation date") }}< / td >
< td >
{% if token.revokation_date %}
{{ token.revokation_date }}
{% else %}
< button type = "submit" class = "ui negative right floated button confirm" name = "action" value = "confirm-revoke" id = "confirm-revoke" >
{% trans %}Revoke token{% endtrans %}
< / button >
< p >
{% trans %}This token has not been revoked{% endtrans %}
< / p >
{% endif %}
< / td >
< / tr >
< tr >
< td > {{ _("Token type") }}< / td >
< td > {{ token.type }}< / td >
< / tr >
< tr >
< td > {{ _("Access token") }}< / td >
< td class = "ui fluid action input" >
< input type = "text" value = "{{ token.access_token }}" readonly class = "copy-text" id = "access-token" data-copy = "access-token" >
< button class = "ui primary right labeled icon button copy-button" data-copy = "access-token" >
< i class = "copy icon" > < / i >
{% trans %}Copy{% endtrans %}
< / button >
< / td >
< / tr >
2022-02-03 08:51:04 +00:00
2023-07-06 16:43:37 +00:00
< tr >
< td > {{ _("Refresh token") }}< / td >
< td class = "ui fluid action input" >
2024-12-06 13:43:31 +00:00
< input type = "text" value = "{{ token.refresh_token or " " } } " readonly class = "copy-text" id = "refresh-token" data-copy = "refresh-token" { % if not token . refresh_token % } placeholder = "{% trans %}No refresh token{% endtrans %}" { % endif % } >
2023-07-06 16:43:37 +00:00
< button class = "ui primary right labeled icon button copy-button" data-copy = "refresh-token" >
< i class = "copy icon" > < / i >
{% trans %}Copy{% endtrans %}
< / button >
< / td >
< / tr >
< / table >
{% endcall %}
2023-03-17 21:27:58 +00:00
< / div >
< / div >
2020-08-26 14:27:08 +00:00
{% endblock %}