Component evidence

prepare_grant_uri (rfc6749/parameters.py)

authlib · authlib/oauth2/rfc6749/parameters.py · python · BSD-3-Clause
auth

Constructs OAuth 2.0 authorization grant request URIs by appending required parameters like client ID and scope to a base URI.

Source preview first 800 characters · full source over MCP
# Source: https://github.com/authlib/authlib | License: BSD-3-Clause | Copyright 2017, Hsiaoming Yang
# Provided via justclaw.it.com; keep this notice with the code.
from authlib.common.encoding import to_unicode
from authlib.common.urls import add_params_to_qs
from authlib.common.urls import add_params_to_uri
from authlib.common.urls import urlparse

from .errors import MismatchingStateException
from .errors import MissingCodeException
from .errors import MissingTokenException
from .errors import MissingTokenTypeException
from .util import list_to_scope


def prepare_grant_uri(
    uri, client_id, response_type, redirect_uri=None, scope=None, state=None, **kwargs
):
    """Prepare the authorization grant request URI.

    The client constructs the request URI by adding the following
    p

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