File: rfc9207.rst

package info (click to toggle)
python-authlib 1.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,016 kB
  • sloc: python: 26,998; makefile: 53; sh: 14
file content (30 lines) | stat: -rw-r--r-- 986 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.. _specs/rfc9207:

RFC9207: OAuth 2.0 Authorization Server Issuer Identification
=============================================================

This section contains the generic implementation of :rfc:`RFC9207 <9207>`.

In summary, RFC9207 advise to return an ``iss`` parameter in authorization code responses.
This can simply be done by implementing the :meth:`~authlib.oauth2.rfc9207.parameter.IssuerParameter.get_issuer` method in the :class:`~authlib.oauth2.rfc9207.parameter.IssuerParameter` class,
and pass it as a :class:`~authlib.oauth2.rfc6749.grants.AuthorizationCodeGrant` extension::

    from authlib.oauth2 import rfc9207

    class IssuerParameter(rfc9207.IssuerParameter):
        def get_issuer(self) -> str:
            return "https://auth.example.org"

    ...

    authorization_server.register_extension(IssuerParameter())

API Reference
-------------

.. module:: authlib.oauth2.rfc9207

.. autoclass:: IssuerParameter
    :member-order: bysource
    :members: