D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
lib
/
python3.6
/
site-packages
/
oauthlib
/
oauth2
/
rfc6749
/
endpoints
/
__pycache__
/
Filename :
resource.cpython-36.pyc
back
Copy
3 ,�[� � @ sV d Z ddlmZmZ ddlZddlmZ ddlmZm Z ej e�ZG dd� de�Z dS ) 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� )�BaseEndpoint�catch_errors_and_unavailabilityc @ sR e Zd ZdZdd� Zedd� �Zedd� �Zedd � �Ze ddd ��Z dd� ZdS )�ResourceEndpointa� Authorizes access to protected resources. The client accesses protected resources by presenting the access token to the resource server. The resource server MUST validate the access token and ensure that it has not expired and that its scope covers the requested resource. The methods used by the resource server to validate the access token (as well as any error responses) are beyond the scope of this specification but generally involve an interaction or coordination between the resource server and the authorization server:: # For most cases, returning a 403 should suffice. The method in which the client utilizes the access token to authenticate with the resource server depends on the type of access token issued by the authorization server. Typically, it involves using the HTTP "Authorization" request header field [RFC2617] with an authentication scheme defined by the specification of the access token type used, such as [RFC6750]:: # Access tokens may also be provided in query and body https://example.com/protected?access_token=kjfch2345sdf # Query access_token=sdf23409df # Body c C s t j| � || _|| _d S )N)r �__init__�_tokens�_default_token)�self� default_tokenZtoken_types� r �/usr/lib/python3.6/resource.pyr / s zResourceEndpoint.__init__c C s | j S )N)r )r r r r r 4 s zResourceEndpoint.default_tokenc C s | j j| j�S )N)�tokens�getr )r r r r �default_token_type_handler8 s z+ResourceEndpoint.default_token_type_handlerc C s | j S )N)r )r r r r r <