
    f@                     l    d dl mZ d dlmZ d dlmZmZ  G d de          Z G d de          ZegZ	dS )	    )reverse)	urlencode)ProviderProviderAccountc                        e Zd Z fdZ xZS )SAMLAccountc                 D    t                                                      S N)superto_str)self	__class__s    c/var/www/equiseq/venv/lib/python3.11/site-packages/allauth/socialaccount/providers/saml/provider.pyr   zSAMLAccount.to_str   s    ww~~    )__name__
__module____qualname__r   __classcell__r   s   @r   r   r      s8                         r   r   c                   l     e Zd ZdZdZeZddgddgdgdd	gd
gdgdZ fdZd Z	d Z
d Zd Zd Z xZS )SAMLProvidersamlSAMLz!http://schemas.auth0.com/clientIDz,urn:oasis:names:tc:SAML:attribute:subject-idz!urn:oid:0.9.2342.19200300.100.1.3zBhttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressz'http://schemas.auth0.com/email_verifiedz?http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givennamezurn:oid:2.5.4.42zurn:oid:2.5.4.4z!http://schemas.auth0.com/nickname)uidemailemail_verified
first_name	last_nameusernamec                      t                      j        |i | | j        j        p| j        j        p| j        | _        d S r
   )r   __init__appname	client_id)r   argskwargsr   s      r   r!   zSAMLProvider.__init__(   s?    $)&)))HMDTX%7D49			r   c                 n    t          dd| j        j        i          }|r|dz   t          |          z   }|S )N
saml_loginorganization_slug)r&   ?)r   r"   r$   r   )r   requestr&   urls       r   get_login_urlzSAMLProvider.get_login_url,   sB    l,?AS+TUUU 	0)i///C
r   c                 *    |                                 S r
   )get_attributesr   datas     r   extract_extra_datazSAMLProvider.extract_extra_data2   s    ""$$$r   c                 8    |                      |          d         S )z
        The `uid` is not unique across different SAML IdP's. Therefore,
        we're using a fully qualified ID: <uid>@<entity_id>.
        r   )_extractr0   s     r   extract_uidzSAMLProvider.extract_uid5   s    
 }}T""5))r   c                 \    |                      |          }|                    dd            |S )Nr   )r4   pop)r   r1   rets      r   extract_common_fieldsz"SAMLProvider.extract_common_fields<   s,    mmD!!t
r   c                    | j         j        }|                                }i }|                    d| j                  }|                                D ]Y\  }}t          |t                    r|g}|D ]9}|                    |dg          }	t          |	          dk    r|	d         ||<    n:Z|                    d          }
|
r|
	                                dv }
|
|d<   |S )Nattribute_mapping r   r   )true1tyyes)
r"   settingsr/   getdefault_attribute_mappingitems
isinstancestrlenlower)r   r1   provider_configraw_attributes
attributesr;   keyprovider_keysprovider_keyattribute_listr   s              r   r4   zSAMLProvider._extractA   s   (+,,..
+//!?
 
 #4"9"9";"; 	 	C--- 0!. -  !/!3!3L2$!G!G~&&**&4Q&7JsOE + $(899 	:+11337UUN+9J'(r   )r   r   r   idr#   r   account_classrD   r!   r-   r2   r5   r9   r4   r   r   s   @r   r   r      s        	BDM 0:

 0P

 6
 N

 
 0
'! !0E E E E E  % % %* * *  
      r   r   N)
django.urlsr   django.utils.httpr   $allauth.socialaccount.providers.baser   r   r   r   provider_classes r   r   <module>rX      s          ' ' ' ' ' ' J J J J J J J J         /      
I I I I I8 I I IX !>   r   