3 ,î[H ã @ sX d Z ddlmZmZ ddlZddlmZ ddlmZm Z ddl mZ G d d „ 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)Ú to_unicodeé )Úparse_token_responseÚprepare_token_requesté )ÚClientc s0 e Zd ZdZdZd ‡ fdd„ Zd dd„Z‡ ZS )ÚServiceApplicationClientaç A public client utilizing the JWT bearer grant. JWT bearer tokes can be used to request an access token when a client wishes to utilize an existing trust relationship, expressed through the semantics of (and digital signature or keyed message digest calculated over) the JWT, without a direct user approval step at the authorization server. This grant type does not involve an authorization step. It may be used by both public and confidential clients. z+urn:ietf:params:oauth:grant-type:jwt-bearerNc s0 t t| ƒj|f|Ž || _|| _|| _|| _dS )ab Initalize a JWT client with defaults for implicit use later. :param client_id: Client identifier given by the OAuth provider upon registration. :param private_key: Private key used for signing and encrypting. Must be given as a string. :param subject: The principal that is the subject of the JWT, i.e. which user is the token requested on behalf of. For example, ``foo@example.com. :param issuer: The JWT MUST contain an "iss" (issuer) claim that contains a unique identifier for the entity that issued the JWT. For example, ``your-client@provider.com``. :param audience: A value identifying the authorization server as an intended audience, e.g. ``https://provider.com/oauth2/token``. :param kwargs: Additional arguments to pass to base client, such as state and token. See Client.__init__.__doc__ for details. N)Úsuperr Ú__init__Úprivate_keyÚsubjectÚissuerÚaudience)ÚselfZ client_idr r r r Úkwargs)Ú __class__© ú)/usr/lib/python3.6/service_application.pyr " s z!ServiceApplicationClient.__init__Ú c K sì ddl }|p| j}|stdƒ‚|p&| j|p.| j|p6| jt|pFtjƒ d ƒt|pTtjƒ ƒdœ} x$dD ]}| | dkrbtd | ƒ‚qbW d | kr˜| jd ƒ| d<