&`rdZddlZddlmZddlmZddlmZmZeje Z GddeZ y) z oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. N)Request)utils) BaseEndpointcatch_errors_and_unavailabilitycxeZdZdZdZdZedZedZedZ edZ e d d Z d Z y) TokenEndpointaToken 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 )POSTcXtj|||_||_||_yN)r__init__ _grant_types_default_token_type_default_grant_type)selfdefault_grant_typedefault_token_type grant_typess I/usr/lib/python3/dist-packages/oauthlib/oauth2/rfc6749/endpoints/token.pyr zTokenEndpoint.__init__?s(d#'#5 #5 c|jSr )rrs rrzTokenEndpoint.grant_typesEs   rc|jSr )rrs rrz TokenEndpoint.default_grant_typeI'''rcL|jj|jSr )rgetrrs rdefault_grant_type_handlerz(TokenEndpoint.default_grant_type_handlerMs##D$;$;<1rr ) r8loggingoauthlib.commonroauthlib.oauth2.rfc6749rbaserr getLoggerr5r*r r;rrrAs8#)?g!e1Le1r