{% from "_form.html" import render_form %}
{% if session.token_info %}

{% trans %}How these tokens were obtained{% endtrans %}

{% trans %}Grant type:{% endtrans %}
{{ session.token_info.grant_type }}
{% if session.token_info.grant and session.token_info.grant != session.token_info.grant_type %}
{% trans %}First obtained with:{% endtrans %}
{{ session.token_info.grant }}
{% endif %} {% if session.token_info.client_auth %}
{% trans %}Client authentication:{% endtrans %}
{{ session.token_info.client_auth }}
{% endif %} {% if session.token_info.pkce %}
{% trans %}PKCE:{% endtrans %}
{{ session.token_info.pkce }}
{% endif %} {% if session.token_info.requested_scope %}
{% trans %}Requested scope:{% endtrans %}
{{ session.token_info.requested_scope }}
{% endif %} {% if session.token_info.token_endpoint %}
{% trans %}Token endpoint:{% endtrans %}
{{ session.token_info.token_endpoint }}
{% endif %}
{% trans %}Obtained at:{% endtrans %}
{{ session.token_info.obtained_at|datetimeformat }}
{% if not tokens_grant.user %}

{% trans %}These tokens are not tied to a user, so there are no user claims to show.{% endtrans %}

{% endif %}
{% endif %} {% if session.token and session.token.id_token and session.user %}

{% trans %}ID token & user information{% endtrans %}

{% trans %}Contains user identity information in JWT format.{% endtrans %}

{% trans %}User claims{% endtrans %}

{% if session.user.picture %} User avatar {% endif %}
{% if session.user.sub %}
{% trans %}User name:{% endtrans %}
{{ session.user.sub }}
{% endif %} {% if session.user.preferred_username %}
{% trans %}Display name:{% endtrans %}
{{ session.user.preferred_username }}
{% endif %} {% if session.user.name %}
{% trans %}Full name:{% endtrans %}
{{ session.user.name }}
{% endif %} {% if session.user.given_name %}
{% trans %}Given name:{% endtrans %}
{{ session.user.given_name }}
{% endif %} {% if session.user.family_name %}
{% trans %}Family name:{% endtrans %}
{{ session.user.family_name }}
{% endif %} {% if session.user.email %}
{% trans %}Email:{% endtrans %}
{{ session.user.email }}
{% endif %} {% if session.user.email_verified is defined %}
{% trans %}Email verified:{% endtrans %}
{{ session.user.email_verified|tojson }}
{% endif %} {% if session.user.phone_number %}
{% trans %}Phone:{% endtrans %}
{{ session.user.phone_number }}
{% endif %} {% if session.user.address %}
{% trans %}Address:{% endtrans %}
{% if session.user.address.get("formatted") %} {{ session.user.address["formatted"] }} {% else %} {% for part in ("street_address", "postal_code", "locality", "region") if session.user.address.get(part) %} {{ session.user.address[part] }}{% if not loop.last %}
{% endif %} {% endfor %} {% endif %}
{% endif %} {% if session.user.locale %}
{% trans %}Locale:{% endtrans %}
{{ session.user.locale }}
{% endif %} {% if session.user.zoneinfo %}
{% trans %}Timezone:{% endtrans %}
{{ session.user.zoneinfo }}
{% endif %} {% if session.user.birthdate %}
{% trans %}Birthdate:{% endtrans %}
{{ session.user.birthdate }}
{% endif %} {% if session.user.gender %}
{% trans %}Gender:{% endtrans %}
{{ session.user.gender }}
{% endif %} {% if session.user.website %}
{% trans %}Website:{% endtrans %}
{{ session.user.website }}
{% endif %} {% if session.user.groups %}
{% trans %}Groups:{% endtrans %}
{% for group in session.user.groups %} {{ group }}{% if not loop.last %}, {% endif %} {% endfor %}
{% endif %}

{% trans %}Token metadata{% endtrans %}

{% if session.user.iss %}
{% trans %}Issuer:{% endtrans %}
{{ session.user.iss }}
{% endif %} {% if session.user.aud %}
{% trans %}Audience:{% endtrans %}
{% if session.user.aud is string %} {{ session.user.aud }} {% else %} {% for aud_item in session.user.aud %} {{ aud_item }}{% if not loop.last %}, {% endif %} {% endfor %} {% endif %}
{% endif %} {% if session.user.auth_time %}
{% trans %}Auth time:{% endtrans %}
{{ session.user.auth_time|datetimeformat }}
{% endif %} {% if session.user.iat %}
{% trans %}Issued at:{% endtrans %}
{{ session.user.iat|datetimeformat }}
{% endif %} {% if session.user.exp %}
{% trans %}Expires at:{% endtrans %}
{{ session.user.exp|datetimeformat }}
{% endif %} {% if session.user.nonce %}
{% trans %}Nonce:{% endtrans %}
{{ session.user.nonce }}
{% endif %} {% if session.user.at_hash %}
{% trans %}Access token hash:{% endtrans %}
{{ session.user.at_hash }}
{% endif %} {% if session.user.c_hash %}
{% trans %}Code hash:{% endtrans %}
{{ session.user.c_hash }}
{% endif %} {% if session.user.acr %}
{% trans %}Auth context class:{% endtrans %}
{{ session.user.acr }}
{% endif %} {% if session.user.amr %}
{% trans %}Auth methods:{% endtrans %}
{% for method in session.user.amr %} {{ method }}{% if not loop.last %}, {% endif %} {% endfor %}
{% endif %} {% if session.user.azp %}
{% trans %}Authorized party:{% endtrans %}
{{ session.user.azp }}
{% endif %}
{% if session.user.auth_time or session.user.acr or session.user.amr %}

{% trans %}Highlighted: changes when you sign in again.{% endtrans %}

{% endif %}
{% endif %} {% if userinfo_endpoint and tokens_grant.user and session.token.access_token %}

{% trans %}UserInfo response{% endtrans %}

{% if userinfo_alg %}

{% trans alg=userinfo_alg %}The client expects a response signed with {{ alg }}.{% endtrans %}

{% endif %} {% if session.userinfo %}
{% trans %}UserInfo endpoint:{% endtrans %}
{{ session.userinfo.endpoint }}
{% trans %}Received at:{% endtrans %}
{{ session.userinfo.received_at|datetimeformat }}
{% if session.userinfo.jwt %}

{% trans %}Signed response{% endtrans %}

{% trans alg=session.userinfo.header.alg %}Signed with {{ alg }}. Authlib checked the signature, iss, aud and sub.{% endtrans %}

{% trans %}Header{% endtrans %}

{{ session.userinfo.header|tojson(indent=2) }}

{% trans %}Claims{% endtrans %}

{% endif %}
{{ session.userinfo.claims|tojson(indent=2) }}
{% else %}

{% trans %}The playground sends the access token to the UserInfo endpoint, which returns the claims of the user.{% endtrans %}

{% endif %} {% if rejected_response and rejected_response.kind == "userinfo" %} {% include "_rejected_response.html" %} {% endif %}
{% call render_form(userinfo_form, url_for('oauth.userinfo'), id="userinfo-form") %} {{ userinfo_form.userinfo() }} {% endcall %}
{% endif %}
{% if session.token and session.token.access_token %}

{% trans %}Access token{% endtrans %}

{% if not tokens_grant.user %}

{% trans %}Used to access protected resources on behalf of the client.{% endtrans %}

{% else %}

{% trans %}Used to access protected resources on behalf of the user.{% endtrans %}

{% endif %}
{% if session.token.token_type %}
{% trans %}Token type:{% endtrans %}
{{ session.token.token_type }}
{% endif %} {% if session.token.expires_in %}
{% trans %}Expires in:{% endtrans %}
{% trans seconds=session.token.expires_in %}{{ seconds }} seconds{% endtrans %}
{% endif %} {% if session.token.expires_at %}
{% trans %}Expires at:{% endtrans %}
{{ session.token.expires_at|datetimeformat }}
{% endif %} {% if session.token.scope %}
{% trans %}Scope:{% endtrans %}
{{ session.token.scope }}
{% endif %}
{% endif %} {% if session.token and session.token.refresh_token %}

{% trans %}Refresh token{% endtrans %}

{% trans %}Used to obtain new access tokens without re-authentication.{% endtrans %}

{% if rejected_response and rejected_response.kind == "refresh" %} {% include "_rejected_response.html" %} {% endif %}
{% call render_form(refresh_form, url_for('oauth.refresh'), id="refresh-form") %} {{ refresh_form.refresh() }} {% endcall %} {% if tokens_grant.provider_session %} {% trans %}The sign-in claims (auth_time, acr, amr) stay the same.{% endtrans %} {% endif %}
{% endif %}
{% if session.token_info and session.token_info.response %}

{% trans %}Token response{% endtrans %}

{{ session.token_info.response|tojson(indent=2) }}
{% endif %}