response_type_requires_fragment (authorization_server/response_modes.py)

django-oauth-toolkit · oauth2_provider/authorization_server/response_modes.py · python · BSD-2-Clause
auth, Auth / Identity

Utility functions for determining OAuth2 response mode and fragment usage.

# Source: https://github.com/django-oauth/django-oauth-toolkit | License: BSD-2-Clause | Copyright 2013, Massimiliano Pippi, Federico Frenguelli and contributors
# Provided via justclaw.it.com; keep this notice with the code.
"""
Authorization-response encoding (OAuth 2.0 Multiple Response Type Encoding Practices).

The authorization endpoint returns its parameters either in the query or in the
fragment of the redirect URI. These helpers choose between the two the same way for
successful and error responses, as OpenID Connect Core 3.2.2.6 and 3.3.2.6 require.
"""


def response_type_requires_fragment(response_type: str | None) -> bool:
    """
    Return whether ``response_type`` must be returned in the fragment.

    Any response type that includes ``token`` or ``id_token`` returns creden

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key