+
    ^eòj¼E  ã                   óF  € ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^RIHt ]P                  ! ]
4      tRR lt]tR t ! R R]4      t ! R R]4      t ! R	 R
]4      t ! R R]4      t ! R R]4      tR tRR ltR t ! R R]4      t ! R R]P4                  4      tR# )é    N)Úoauth2c                ó¼   € V R\        V 4      ) ^,          ,          ,          p \        V 4      p \        P                  ! V 4      pV'       d   VP	                  V4      pV# )a´  Decode a part of the JWT.

JWT is encoded by padding-less base64url,
based on `JWS specs <https://tools.ietf.org/html/rfc7515#appendix-C>`_.

:param encoding:
    If you are going to decode the first 2 parts of a JWT, i.e. the header
    or the payload, the default value "utf-8" would work fine.
    If you are going to decode the last part i.e. the signature part,
    it is a binary string so you should use `None` as encoding here.
Ú=)ÚlenÚstrÚbase64Úurlsafe_b64decodeÚdecode)ÚrawÚencodingÚoutputs   && ÚŠ/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/msal/oauth2cli/oidc.pyÚdecode_partr      sT   € ð ˆ3”3�s“8�)˜a•-Õ Õ €CÜ
ð 	ó€Cô ×%Ò% cÓ*€FßØ—‘˜xÓ(ˆØ€Mó    c                 óX   € \         P                  ! R \         P                  ! V 4      4      # )z%Y-%m-%d %H:%M:%S)ÚtimeÚstrftimeÚ	localtime)Úepochs   &r   Ú_epoch_to_localr   &   s   € Ü�=Š=Ð,¬d¯nªn¸UÓ.CÓDÐDr   c                   ó6   a a€ ] tR t^)t oRtV 3R ltRtVtV ;t# )ÚIdTokenErrorzMIn unlikely event of an ID token is malformed, this exception will be raised.c                ó>  <€ \         \        T `  V: R \        V4      : R\        P
                  ! \        TVP                  R4      '       d   \        VR,          4      MRVP                  R4      '       d   \        VR,          4      MRR7      ^R7      : 24       R# )z Current epoch = z#.  The id_token was approximately: ÚiatNÚexp)r   r   ©Úindent)Úsuperr   Ú__init__r   ÚjsonÚdumpsÚdictÚget©ÚselfÚreasonÚnowÚclaimsÚ	__class__s   &&&&€r   r   ÚIdTokenError.__init__+   ss   ø€ ÜŒl˜DÑ*ã”O CÖ(¬$¯*ª*´TØØ6<·j±jÀ×6GÒ6G”O F¨5¥MÔ2ÈTØ6<·j±jÀ×6GÒ6G”O F¨5¥MÔ2ÈTô6ð ö	+ðö	r   © )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r)   Ú__classdict__s   @@r   r   r   )   s   ù‡ € ÙW÷õ r   r   c                   ó<   a a€ ] tR t^4t oRtV 3R ltR tRtVtV ;t	# )Ú_IdTokenTimeErrorz>Make sure your computer's time and time zone are both correct.c                ó`   <€ \         \        V `  VR ,           V P                  ,           W#4       R# )Ú N)r   r7   r   Ú_SUGGESTIONr$   s   &&&&€r   r   Ú_IdTokenTimeError.__init__6   s%   ø€ ÜÔ Ñ/°¸µ¸d×>NÑ>NÕ0NÐPSÖ\r   c                óB   € \         P                  \        V 4      4       R # ©N)ÚloggerÚwarningr   )r%   s   &r   ÚlogÚ_IdTokenTimeError.log8   s   € ô 	�‰”s˜4“yÖ!r   r+   )
r,   r-   r.   r/   r:   r   r@   r1   r2   r3   r4   s   @@r   r7   r7   4   s   ù‡ € ØR€Kõ]÷
"ò 
"r   r7   c                   ó   € ] tR t^DtRtR# )ÚIdTokenIssuerErrorr+   N©r,   r-   r.   r/   r1   r+   r   r   rC   rC   D   ó   † Ûr   rC   c                   ó   € ] tR t^GtRtR# )ÚIdTokenAudienceErrorr+   NrD   r+   r   r   rG   rG   G   rE   r   rG   c                   ó   € ] tR t^JtRtR# )ÚIdTokenNonceErrorr+   NrD   r+   r   r   rI   rI   J   rE   r   rI   c                ól   € \         P                  ! \        V P                  R4      ^,          4      4      # )a?  Decode an id_token and return its claims as a dictionary, WITHOUT validation.

MSAL does not validate the ID token. Per OpenID Connect, an ID token that is
obtained via direct communication between the client and the token endpoint
(which is how MSAL retrieves tokens) does not need to be validated by the
client. Validation, if needed, is the responsibility of the application,
which can perform it at the appropriate time (see the issue below).
https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/911

ID token claims would at least contain: "iss", "sub", "aud", "exp", "iat",
per `specs <https://openid.net/specs/openid-connect-core-1_0.html#IDToken>`_
and it may contain other optional content such as "preferred_username",
`maybe more <https://openid.net/specs/openid-connect-core-1_0.html#Claims>`_
Ú.)r    Úloadsr   Úsplit)Úid_tokens   &r   Ú_decode_id_token_claimsrO   M   s&   € ô �:Š:”k (§.¡.°Ó"5°aÕ"8Ó9Ó:Ð:r   c                ó*  € \         P                  ! R\        ^R7       \        P                  ! \        V P                  R4      ^,          4      4      p\        T;'       g    \        P                  ! 4       4      p^xpWg,           VP                  RV^,
          4      8  d   \        RWe4      P                  4        V'       d"   W%R,          8w  d   \        RV,          VV4      hV'       dP   \        VR,          \        4      '       d   WR,          9   M
WR,          8H  pV'       g   \        R	V,          VV4      hWg,
          VR
,          8”  d   \        RWe4      P                  4        V'       d#   W5P                  R4      8w  d   \!        RVV4      hV# )aŸ  Decodes and validates an id_token and returns its claims as a dictionary.

.. deprecated:: 1.38.0
    MSAL's token acquisition no longer validates the ID token, because the
    SDK should not perform any ID token validation
    (`issue #911 <https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/911>`_).
    This standalone helper is kept only for backward compatibility and it
    still performs the legacy validations described below. Prefer the
    ``id_token_claims`` that MSAL already returns alongside each token, or
    decode the token yourself, and perform any validation your app requires.

ID token claims would at least contain: "iss", "sub", "aud", "exp", "iat",
per `specs <https://openid.net/specs/openid-connect-core-1_0.html#IDToken>`_
and it may contain other optional content such as "preferred_username",
`maybe more <https://openid.net/specs/openid-connect-core-1_0.html#Claims>`_
z÷decode_id_token() is deprecated. MSAL's token acquisition no longer validates the ID token; validation is the application's responsibility. This legacy helper still performs some validation. Prefer the id_token_claims returned alongside the token.)Ú
stacklevelrK   Únbfz!0. The ID token is not yet valid.ÚisszŸ2. The Issuer Identifier for the OpenID Provider, "%s", (which is typically obtained during Discovery), MUST exactly match the value of the iss (issuer) Claim.Úaudz|3. The aud (audience) claim must contain this client's client_id "%s", case-sensitively. Was your client_id in wrong casing?r   z 9. The ID token already expires.ÚnoncezX11. Nonce must be the same value as the one that was sent in the Authentication Request.)ÚwarningsÚwarnÚDeprecationWarningr    rL   r   rM   Úintr   r#   r7   r@   rC   Ú
isinstanceÚlistrG   rI   )	rN   Ú	client_idÚissuerrU   r'   ÚdecodedÚ_nowÚskewÚ	valid_auds	   &&&&&    r   Údecode_id_tokenrb   _   sl  € ô" ‡M‚Mð	Cô 	 qõ*ô �jŠjœ X§^¡^°CÓ%8¸Õ%;Ó<Ó=€Gäˆs×!Ð!”d—i’i“kÓ"€DØ€Dà…{�W—[‘[ ¨¨q­Ó1Ô1ô 	Ð=¸tÓM×QÑQÔSç�& E�NÔ*ä ðFàHNõOð Øóð 	÷ Ü3=Ø�E�NœD÷4"ò 4"�I¨¥Ò/Ø'0¸EµNÑ'Bð 	çÜ&ðNð õð Øóð ð …{�W˜U•^Ô#ÜÐ<¸dÓL×PÑPÔRç�Ÿ+™+ gÓ.Ô.ÜðFàØó	ð 	ð €Nr   c                 óh   € \         P                  ! V P                  R 4      4      P                  4       # )Úascii)ÚhashlibÚsha256ÚencodeÚ	hexdigest)rU   s   &r   Ú_nonce_hashri   ¨   s#   € ä�>Š>˜%Ÿ,™, wÓ/Ó0×:Ñ:Ó<Ð<r   c                   ó.   € ] tR t^­tRtRtRtRtRtRt	Rt
R# )	ÚPromptz™This class defines the constant strings for prompt parameter.

The values are based on
https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
ÚnoneÚloginÚconsentÚselect_accountÚcreater+   N)r,   r-   r.   r/   r0   ÚNONEÚLOGINÚCONSENTÚSELECT_ACCOUNTÚCREATEr1   r+   r   r   rk   rk   ­   s"   † ñð
 €DØ€EØ€GØ%€NØ„Fr   rk   c                   óŒ   a a€ ] tR t^ºt oRtR
R ltV 3R ltR
V 3R lltR
V 3R lltR
V 3R llt	V 3R lt
RV 3R lltR	tVtV ;t# )ÚClientz^OpenID Connect is a layer on top of the OAuth2.

See its specs at https://openid.net/connect/
c                ód   € \        WV P                  V P                  P                  R4      R7      # )zõSee :func:`~decode_id_token`.

.. deprecated:: 1.38.0
    MSAL's token acquisition no longer validates the ID token. This
    method is kept for backward compatibility and still performs the
    legacy validations. See :func:`~decode_id_token`.
r]   )rU   r\   r]   )rb   r\   Úconfigurationr#   )r%   rN   rU   s   &&&r   rb   ÚClient.decode_id_tokenÀ   s0   € ô ØØ—n‘n¨T×-?Ñ-?×-CÑ-CÀHÓ-MôOð 	Or   c                óp   <€ \         \        V `
  ! V.VO5/ VB pRV9   d   \        VR,          4      VR&   V# )z�The result will also contain one more key "id_token_claims",
whose value is a dictionary of the (non-validated) ID token claims.
rN   Úid_token_claims)r   rw   Ú_obtain_tokenrO   )r%   Ú
grant_typeÚargsÚkwargsÚretr)   s   &&*, €r   r}   ÚClient._obtain_tokenÌ   sC   ø€ ô ”F˜DÒ/°
ÐL¸TÒLÀVÑLˆØ˜Ôô &=¸SÀ½_Ó%MˆCÐ!Ñ"Øˆ
r   c                óh   <€ \         P                  ! R\        4       \        \        V `  ! V3RV/VB # )af  Generate an authorization uri to be visited by resource owner.

Return value and all other parameters are the same as
:func:`oauth2.Client.build_auth_request_uri`, plus new parameter(s):

:param nonce:
    A hard-to-guess string used to mitigate replay attacks. See also
    `OIDC specs <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
z%Use initiate_auth_code_flow() insteadrU   )rV   rW   rX   r   rw   Úbuild_auth_request_uri)r%   Úresponse_typerU   r€   r)   s   &&&,€r   r„   ÚClient.build_auth_request_uriØ   s<   ø€ ô 	�ŠÐ=Ô?QÔRÜ”V˜TÒ9Øñ2Ø!&ð2Ø*0ñ2ð 	2r   c                óü   <€ \         P                  ! R\        4       \        \        V `  ! V3/ VB pVP                  R/ 4      P                  R4      pRV9   d#   V'       d   W%8w  d   \        RV: RV: R24      hV# )a²  Get a token via authorization code. a.k.a. Authorization Code Grant.

Return value and all other parameters are the same as
:func:`oauth2.Client.obtain_token_by_authorization_code`,
plus new parameter(s):

:param nonce:
    If you provided a nonce when calling :func:`build_auth_request_uri`,
    same nonce should also be provided here, so that we'll validate it.
    An exception will be raised if the nonce in id token mismatches.
z,Use obtain_token_by_auth_code_flow() insteadr|   rU   úThe nonce in id token ("z") should match your nonce ("ú"))rV   rW   rX   r   rw   Ú"obtain_token_by_authorization_coder#   Ú
ValueError)r%   ÚcoderU   r€   ÚresultÚnonce_in_id_tokenr)   s   &&&,  €r   rŠ   Ú)Client.obtain_token_by_authorization_codeæ   s~   ø€ ô 	�ŠØ:Ô<Nô	Pä”v˜tÒGØñØñˆà"ŸJ™JÐ'8¸"Ó=×AÑAÀ'ÓJÐØ Ô&¯5°UÔ5OÝã"£Eð+ó,ð ,ð ˆr   c           	     óZ  <€ RVP                  RR4      9   d   \        R4      hV'       d   \        V4      M. pRV9  d   VP                  R4       \        P
                  ! ^4      p\        \        V `"  ! R	RVR\        V4      /VB pWER&   VP                  R4      e   VR,          VR&   V# )
a|  Initiate an auth code flow.

It provides nonce protection automatically.

:param list scope:
    A list of strings, e.g. ["profile", "email", ...].
    This method will automatically send ["openid"] to the wire,
    although it won't modify your input list.

See :func:`oauth2.Client.initiate_auth_code_flow` in parent class
for descriptions on other parameters and return value.
rN   r…   Ú z+response_type="id_token ..." is not allowedÚopenidÚscoperU   Úmax_ager+   )
r#   r‹   r[   ÚappendÚsecretsÚtoken_urlsafer   rw   Úinitiate_auth_code_flowri   )r%   r“   r€   Ú_scoperU   Úflowr)   s   &&,   €r   r˜   ÚClient.initiate_auth_code_flowý   s°   ø€ ð  ˜Ÿ™ O°RÓ8Ô8ô ÐJÓKÐKß %”�e”¨2ˆØ˜6Ô!ð �M‰M˜(Ô#Ü×%Ò% bÓ)ˆÜ”V˜TÒ:ñ >Øð>Ü +¨EÓ 2ð>Ø6<ñ>ˆàˆW‰Ø�:‰:�iÓ Ò,Ø$ YÕ/ˆD�‰OØˆr   c                ób  <€ \         \        V `
  ! W3/ VB pRV9   Ed   VP                  R/ 4      P                  R4      p\	        VR,          4      pWV8w  d   \        RV: RV: R24      hVP                  R4      e±   VP                  R/ 4      P                  R4      pV'       g   \        R4      h\        \        P                  ! 4       4      p^xp	W‰,
          WqR,          ,           8”  dC   \        R	P                  VVR,          V\        P                  ! VR,          ^R
7      R7      4      hV# )a…  Validate the auth_response being redirected back, and then obtain tokens,
including ID token which can be used for user sign in.

Internally, it implements nonce to mitigate replay attack.
It also implements PKCE to mitigate the auth code interception attack.

See :func:`oauth2.Client.obtain_token_by_auth_code_flow` in parent class
for descriptions on other parameters and return value.
r|   rU   rˆ   z") should match our nonce ("r‰   r”   Ú	auth_timez<13. max_age was requested, ID token should contain auth_timez½13. auth_time ({auth_time}) was requested, by using max_age ({max_age}) parameter, and now ({now}) too much time has elasped since last end-user authentication. The ID token was: {id_token}r   )r�   r”   r'   rN   )r   rw   Úobtain_token_by_auth_code_flowr#   ri   ÚRuntimeErrorrY   r   Úformatr    r!   )r%   Úauth_code_flowÚauth_responser€   r�   rŽ   Úexpected_hashr�   r'   r`   r)   s   &&&,      €r   rž   Ú%Client.obtain_token_by_auth_code_flow"  s+  ø€ ô ”v˜tÒCØñ5Ø-3ñ5ˆà Õ&Ø &§
¡
Ð+<¸bÓ A× EÑ EÀgÓ NÐÜ'¨°wÕ(?Ó@ˆMØ Ô1Ý"ã&«ð7ó8ð 8ð ×!Ñ! )Ó,Ò8Ø"ŸJ™JÐ'8¸"Ó=×AÑAÀ+ÓN�	ß Ü&ØVóXð Xäœ$Ÿ)š)›+Ó&�Ø�Ø•: 	¸9Õ,EÕ EÔEÜ&ð;÷ <B¹6Ø"+Ø .¨yÕ 9ØÜ!%§¢¨FÐ3DÕ,EÈaÔ!Pð	 <Bó <ó
ð 
ð ˆr   c           
     ó<  <€ \        \        V\        \        34      '       d   RP	                  V4      MTVVVVVVR7      P                  4        U	U
u/ uF  w  ršV
f   K  WšbK  	  pp	p
\        \        V `"  ! RR\        VP                  R/ 4      3/ VB /VB # u up
p	i )a¿  A native app can use this method to obtain token via a local browser.

Internally, it implements nonce to mitigate replay attack.
It also implements PKCE to mitigate the auth code interception attack.

:param string display: Defined in
    `OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
:param string prompt: Defined in
    `OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
    You can find the valid string values defined in :class:`oidc.Prompt`.

:param int max_age: Defined in
    `OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
:param string ui_locales: Defined in
    `OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
:param string id_token_hint: Defined in
    `OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
:param string login_hint: Defined in
    `OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.
:param string acr_values: Defined in
    `OIDC <https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest>`_.

See :func:`oauth2.Client.obtain_token_by_browser` in parent class
for descriptions on other parameters and return value.
r9   )ÚpromptÚdisplayr”   Ú
ui_localesÚid_token_hintÚ
login_hintÚ
acr_valuesÚauth_paramsr+   )
r"   rZ   r[   ÚtupleÚjoinÚitemsr   rw   Úobtain_token_by_browserÚpop)r%   r§   r¦   r”   r¨   r©   rª   r«   r€   ÚkÚvÚfiltered_paramsr)   s   &&&&&&&&,   €r   r°   ÚClient.obtain_token_by_browserK  sµ   ø€ ôH ,0Ü'1°&¼4Ä¸-×'HÒ'H�3—8‘8˜FÔ#ÈfØØØ!Ø'Ø!Ø!ô,÷ ‰e‹gð,ô (ñ ,¡4 1ð ô ˜1š3ñ ,ˆñ (ô ”V˜TÒ:ñ Ü˜VŸZ™Z¨°rÓ:ÑN¸oÑNðàñð 	ùó(s   ÁBÁBr+   r=   )NNNNNNN)r,   r-   r.   r/   r0   rb   r}   r„   rŠ   r˜   rž   r°   r1   r2   r3   r4   s   @@r   rw   rw   º   s5   ù‡ € ñô

Oõ
÷2÷÷.#õJ'÷R/÷ /r   rw   )zutf-8)NNNN)r    r   r   r–   rV   re   Úloggingr‘   r   Ú	getLoggerr,   r>   r   Úbase64decoder   rŸ   r   r7   rC   rG   rI   rO   rb   ri   Úobjectrk   rw   r+   r   r   Ú<module>rº      s¬   ðÛ Û Û Û Û Û Û å ð 
×	Ò	˜8Ó	$€ôð, €òEô	�<ô 	ô"˜ô "ô 	˜ô 	ô	˜<ô 	ô	˜ô 	ò;ô$FòR=ô

ˆVô 
ô@ˆV�]‰]ö @r   