o
    i                     @   sL   d Z ddlmZmZmZ ddlmZmZmZ erddl	Z	G dd deZ
dS )zLine SSO Login Helper.    )TYPE_CHECKINGClassVarOptional)DiscoveryDocumentOpenIDSSOBaseNc                   @   sT   e Zd ZU dZdZdZg dZeed< de	fddZ
dd
eded defddZd	S )LineSSOz%Class providing login via Line OAuth.linezhttps://api.line.me/oauth2/v2.1)emailZprofileZopenidscopereturnc                    s   d| j  d| j  ddS )z#Get document containing handy urls.z,https://access.line.me/oauth2/v2.1/authorizez/tokenz	/userinfo)Zauthorization_endpointZtoken_endpointZuserinfo_endpoint)base_url)self r   K/home/app/Keep/.python/lib/python3.10/site-packages/fastapi_sso/sso/line.pyget_discovery_document   s
   

zLineSSO.get_discovery_documentNresponsesessionzhttpx.AsyncClientc              
      s2   t |ddd|d| j|d|ddS )z5Return OpenID from user information provided by Line.r
   Nnamesubpicture)r
   Z
first_name	last_nameZdisplay_nameprovideridr   )r   getr   )r   r   r   r   r   r   openid_from_response   s   zLineSSO.openid_from_response)N)__name__
__module____qualname____doc__r   r   r   r   __annotations__r   r   dictr   r   r   r   r   r   r   r      s   
  r   )r   typingr   r   r   Zfastapi_sso.sso.baser   r   r   Zhttpxr   r   r   r   r   <module>   s    