a
    Qx_                     @   s\   d dl Z d dlmZ d dlmZmZmZ ddlmZ G dd deZ	e
e	Ze
e	ZdS )    N)app_settings)OAuth2AdapterOAuth2CallbackViewOAuth2LoginView   )OrcidProviderc                   @   sz   e Zd ZejZdZdZej	
ei Ze
deZe
deZderHdndeZdeZd	eZd
eZdd ZdS )OrcidOAuth2AdapterFz	orcid.orgZBASE_DOMAINZ
MEMBER_APIz{0}.{1}ZapiZpubzhttps://{0}/oauth/authorizezhttps://{0}/oauth/tokenzhttps://{0}/v2.1/%s/recordc                 K   sN   i }| j r|j|d< tj| j|d d  |ddid}| }|  ||S )NZaccess_tokenresponseZorcidacceptzapplication/orcid+json)paramsheaders)
member_apitokenrequestsgetprofile_urljsonget_providerZsociallogin_from_response)selfrequestZappr   kwargsr   Zresp
extra_data r   c/var/www/html/Ranjet/env/lib/python3.9/site-packages/allauth/socialaccount/providers/orcid/views.pycomplete_login    s    
z!OrcidOAuth2Adapter.complete_loginN)__name__
__module____qualname__r   idZprovider_idZmember_api_defaultZbase_domain_defaultr   Z	PROVIDERSr   settingsZbase_domainr   formatZ
api_domainZauthorize_urlZaccess_token_urlr   r   r   r   r   r   r      s   


r   )r   Zallauth.socialaccountr   Z,allauth.socialaccount.providers.oauth2.viewsr   r   r   Zproviderr   r   Zadapter_viewZoauth2_loginZoauth2_callbackr   r   r   r   <module>   s   !
