HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/oauthlib/oauth2/rfc6749/endpoints/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/oauthlib/oauth2/rfc6749/endpoints/__pycache__/token.cpython-311.pyc
�

&�`���v�dZddlZddlmZddlmZddlmZmZej	e
��ZGd�de��ZdS)	z�
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
�N)�Request)�utils�)�BaseEndpoint�catch_errors_and_unavailabilityc��eZdZdZdZd�Zed���Zed���Zed���Z	ed���Z
e			dd
���Zd�Z
d	S)
�
TokenEndpointa�Token issuing endpoint.

    The token endpoint is used by the client to obtain an access token by
    presenting its authorization grant or refresh token.  The token
    endpoint is used with every authorization grant except for the
    implicit grant type (since an access token is issued directly).

    The means through which the client obtains the location of the token
    endpoint are beyond the scope of this specification, but the location
    is typically provided in the service documentation.

    The endpoint URI MAY include an "application/x-www-form-urlencoded"
    formatted (per `Appendix B`_) query component,
    which MUST be retained when adding additional query parameters.  The
    endpoint URI MUST NOT include a fragment component::

        https://example.com/path?query=component             # OK
        https://example.com/path?query=component#fragment    # Not OK

    Since requests to the token endpoint result in the transmission of
    clear-text credentials (in the HTTP request and response), the
    authorization server MUST require the use of TLS as described in
    Section 1.6 when sending requests to the token endpoint::

        # We will deny any request which URI schema is not with https

    The client MUST use the HTTP "POST" method when making access token
    requests::

        # HTTP method is currently not enforced

    Parameters sent without a value MUST be treated as if they were
    omitted from the request.  The authorization server MUST ignore
    unrecognized request parameters.  Request and response parameters
    MUST NOT be included more than once::

        # Delegated to each grant type.

    .. _`Appendix B`: https://tools.ietf.org/html/rfc6749#appendix-B
    )�POSTc�X�tj|��||_||_||_dS�N)r�__init__�_grant_types�_default_token_type�_default_grant_type)�self�default_grant_type�default_token_type�grant_typess    �I/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/endpoints/token.pyr
zTokenEndpoint.__init__?s1����d�#�#�#�'���#5�� �#5�� � � �c��|jSr)r�rs rrzTokenEndpoint.grant_typesEs��� � rc��|jSr)rrs rrz TokenEndpoint.default_grant_typeI����'�'rc�@�|j�|j��Sr)r�getrrs r�default_grant_type_handlerz(TokenEndpoint.default_grant_type_handlerMs����#�#�D�$;�<�<�<rc��|jSr)rrs rrz TokenEndpoint.default_token_typeQrrr
Nc��t||||���}|�|��tj|j��|_||_|r||_|r||_|j	�
|j|j��}	t�
d|j|	��|	�||j��S)z7Extract grant_type and route to the designated handler.)�http_method�body�headersz(Dispatching grant_type %s request to %r.)r�validate_token_requestr�
scope_to_list�scope�scopes�extra_credentials�
grant_type�claimsrrr�log�debug�create_token_responser)
r�urir r!r"�credentials�grant_type_for_scoper)�request�grant_type_handlers
          rr,z#TokenEndpoint.create_token_responseUs���
��[�t�W�F�F�F���#�#�G�,�,�,�
�,�W�]�;�;���$/��!��	6�!5�G���	$�#�G�N�!�-�1�1�'�2D�26�2Q�S�S���	�	�<��$�&8�	:�	:�	:�!�7�7��T�,�.�.�	.rc�Z�|�|��|�|��dSr)�_raise_on_bad_method�_raise_on_bad_post_request)rr0s  rr#z$TokenEndpoint.validate_token_requestus0���!�!�'�*�*�*��'�'��0�0�0�0�0r)r
NNNNN)�__name__�
__module__�__qualname__�__doc__�valid_request_methodsr
�propertyrrrrrr,r#�rrr	r	s�������'�'�R&��6�6�6��!�!��X�!��(�(��X�(��=�=��X�=��(�(��X�(�%�BF�SW�%)�.�.�.�%�$�.�>1�1�1�1�1rr	)
r8�logging�oauthlib.commonr�oauthlib.oauth2.rfc6749r�baserr�	getLoggerr5r*r	r;rr�<module>rAs���������#�#�#�#�#�#�)�)�)�)�)�)�?�?�?�?�?�?�?�?��g���!�!��e1�e1�e1�e1�e1�L�e1�e1�e1�e1�e1r