Server IP : 192.158.238.246 / Your IP : 3.23.59.187 Web Server : LiteSpeed System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64 User : jenniferflocom ( 1321) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/endpoints/__pycache__/ |
Upload File : |
3 ,�[� � @ sb d Z ddlmZmZ ddlZddlmZ ddlmZ ddl m Z mZ eje �ZG dd � d e �ZdS ) z� oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. � )�absolute_import�unicode_literalsN)�Request)�utils� )�BaseEndpoint�catch_errors_and_unavailabilityc @ sV e Zd ZdZdd� Zedd� �Zedd� �Zedd � �Zed d� �Z e ddd��Zd 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 authorization endpoint result in user 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 c C s t j| � || _|| _|| _d S )N)r �__init__�_grant_types�_default_token_type�_default_grant_type)�self�default_grant_type�default_token_type�grant_types� r �/usr/lib/python3.6/token.pyr A s zTokenEndpoint.__init__c C s | j S )N)r )r r r r r G s zTokenEndpoint.grant_typesc C s | j S )N)r )r r r r r K s z TokenEndpoint.default_grant_typec C s | j j| j�S )N)r �getr )r r r r �default_grant_type_handlerO s z(TokenEndpoint.default_grant_type_handlerc C s | j S )N)r )r r r r r S s z TokenEndpoint.default_token_type�GETNc C sh t ||||d�}tj|j�|_||_|r.||_|r8||_| jj |j| j �} tjd|j| � | j || j�S )z7Extract grant_type and route to the designated handler.)�http_method�body�headersz(Dispatching grant_type %s request to %r.)r r Z scope_to_listZscopeZscopesZextra_credentialsZ grant_type�claimsr r r �log�debug�create_token_responser ) r Zurir r r ZcredentialsZgrant_type_for_scoper ZrequestZgrant_type_handlerr r r r W s z#TokenEndpoint.create_token_response)r NNNNN)�__name__� __module__�__qualname__�__doc__r �propertyr r r r r r r r r r r s * r )r! Z __future__r r ZloggingZoauthlib.commonr Zoauthlib.oauth2.rfc6749r �baser r Z getLoggerr r r r r r r �<module> s