
    qh                     *    S r SSKJr   " S S\5      rg)z
Clef OAuth support.

This contribution adds support for Clef OAuth service. The settings
SOCIAL_AUTH_CLEF_KEY and SOCIAL_AUTH_CLEF_SECRET must be defined with the
values given by Clef application registration process.
   )
BaseOAuth2c                   N   ^  \ rS rSrSrSrSrSrSrU 4S jr	S r
S	 rS
 rSrU =r$ )
ClefOAuth2   z!Clef OAuth authentication backendclefzhttps://clef.io/iframes/qrz https://clef.io/api/v1/authorize,c                 x   > [         TU ]  " U0 UD6nUR                  S5      US'   UR                  S5      US'   U$ )N	client_idapp_idredirect_uriredirect_url)superauth_paramspop)selfargskwargsparams	__class__s       K/var/www/html/env/lib/python3.13/site-packages/social_core/backends/clef.pyr   ClefOAuth2.auth_params   sB    $d5f5!::k2x!'N!;~    c                 B    UR                  S5      R                  S5      $ )Ninfoid)get)r   responsedetailss      r   get_user_idClefOAuth2.get_user_id   s    {{6"&&t,,r   c           	      6   UR                  S5      nU R                  UR                  S5      UR                  S5      S9u  p4nUR                  SS5      nU(       a  UR                  SS5      S	   OUR                  S
5      nUUUUUUR                  SS5      S.$ )z'Return user details from Github accountr   
first_name	last_name)r"   r#   email @r       r   phone_number)usernamer$   fullnamer"   r#   r(   )r   get_user_namessplit)r   r   r   r*   r"   r#   r$   r)   s           r   get_user_detailsClefOAuth2.get_user_details   s    ||F#*.*=*=xx-+9N +> +
'i "%-25;;sA&q) ! $" HH^R8
 	
r   c                 &    U R                  SSU0S9$ )Nzhttps://clef.io/api/v1/infoaccess_token)r   )get_json)r   r0   r   r   s       r   	user_dataClefOAuth2.user_data0   s"    }})><2P  
 	
r    )__name__
__module____qualname____firstlineno____doc__nameAUTHORIZATION_URLACCESS_TOKEN_URLSCOPE_SEPARATORr   r   r-   r2   __static_attributes____classcell__)r   s   @r   r   r      s5    +D49O-
&
 
r   r   N)r9   oauthr   r   r4   r   r   <module>rA      s    '
 '
r   