<?xml 
version="1.0" encoding="utf-8"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
>

<channel xml:lang="fr">
	<title>OpenID Connect OAuth Server d&#233;di&#233; </title>
	<link>https://oa.dnc.global/</link>
	<description>OAuth Server by DnC (OAuthSD) est un serveur d'authentification qui impl&#233;mente OAuth 2.0 et OpenID Connect.
Avec la connexion unique, une entit&#233; permet aux utilisateurs de ses applications de naviguer de l'une &#224; l'autre de fa&#231;on trans-parente. En centralisant l'authentification des applications et des utilisateurs, un serveur OpenID Connect permet de contr&#244;ler parfaitement l'acc&#232;s des applications et des utilisateurs aux informations sensibles.</description>
	<language>fr</language>
	<generator>SPIP - www.spip.net</generator>

	<image>
		<title>&lt;small&gt;OpenID Connect&lt;/small&gt; OAuth Server &lt;small&gt; d&#233;di&#233; &lt;/small&gt;</title>
		<url>https://static.oa.dnc.global/local/cache-vignettes/L144xH126/siteon0-a21bf.png?1733820003</url>
		<link>https://oa.dnc.global/</link>
		<height>126</height>
		<width>144</width>
	</image>



<item xml:lang="fr">
		<title>JWT : Un module de validation en Python</title>
		<link>https://static.oa.dnc.global/-OpenID-Connect-6-.html#jwtunmoduledevalidationenpython</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-OpenID-Connect-6-.html#jwtunmoduledevalidationenpython</guid>
		<dc:date>2026-02-14T07:50:26Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;Un module utilitaire pour : &lt;br class='autobr' /&gt; d&#233;coder un JWT,
&lt;br class='autobr' /&gt; v&#233;rifier sa signature (HMAC ou RSA),
&lt;br class='autobr' /&gt; prot&#232;ger contre les attaques par timing,
&lt;br class='autobr' /&gt; l&#232;ver des exceptions explicites,
&lt;br class='autobr' /&gt; valider les claims pour garantir que le token est encore valable et destin&#233; au service. &lt;br class='autobr' /&gt;
C'est une impl&#233;mentation qui &#233;vite les bo&#238;tes noires, donc parfaitement ma&#238;tris&#233;e. &lt;br class='autobr' /&gt;
Ce module Python fournit une impl&#233;mentation bas niveau. Il ne d&#233;pend pas de biblioth&#232;ques haut niveau comme PyJWT : on ma&#238;trise enti&#232;rement le processus. &lt;br class='autobr' /&gt;
Comment cela (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-OpenID-Connect-6-.html" rel="directory"&gt;OpenID Connect&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_chapo'&gt;&lt;p&gt;Un module utilitaire pour :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; d&#233;coder un JWT,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; v&#233;rifier sa signature (HMAC ou RSA),
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; prot&#232;ger contre les attaques par timing,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; l&#232;ver des exceptions explicites,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; valider les claims pour garantir que le token est encore valable et destin&#233; au service.&lt;/p&gt;
&lt;p&gt;C'est une impl&#233;mentation qui &#233;vite les bo&#238;tes noires, donc parfaitement ma&#238;tris&#233;e.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;p&gt;Ce module Python fournit une impl&#233;mentation bas niveau. Il ne d&#233;pend pas de biblioth&#232;ques haut niveau comme PyJWT : on ma&#238;trise enti&#232;rement le processus.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comment cela fonctionne (&#233;tape par &#233;tape)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; 1) D&#233;coupage du JWT&lt;br class='autobr' /&gt;
Le token doit avoir la forme :&lt;/p&gt;
&lt;p&gt;header.payload.signature&lt;/p&gt;
&lt;p&gt;Le code v&#233;rifie :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; qu'il y a bien 3 segments,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; qu'ils sont valides en Base64URL,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; qu'ils contiennent du JSON correct.&lt;/p&gt;
&lt;p&gt;En cas de probl&#232;me &#8594; `JWTFormatError`.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; 2) D&#233;codage Base64URL&lt;br class='autobr' /&gt;
Chaque segment est d&#233;cod&#233; en bytes, avec ajout automatique du padding `=` si n&#233;cessaire.&lt;/p&gt;
&lt;p&gt;En cas d'erreur &#8594; `JWTFormatError`.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; 3) Analyse du header&lt;br class='autobr' /&gt;
Le header doit contenir un champ :&lt;/p&gt;
&lt;p&gt;&#034;alg&#034; : &#034;HS256&#034; | &#034;RS256&#034; | ...&lt;/p&gt;
&lt;p&gt;Si l'algorithme est absent ou non autoris&#233; &#8594; `JWTAlgorithmError`.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; 4) V&#233;rification de la signature&lt;br class='autobr' /&gt;
Selon l'algorithme :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; HMAC (HS256 / HS384 / HS512)&lt;br class='autobr' /&gt;
Recalcul du HMAC avec la cl&#233; secr&#232;te&lt;br class='autobr' /&gt;
Comparaison en temps constant (Time Constant Comparison) : `compare_digest` &lt;br class='autobr' /&gt; &#8594; prot&#232;ge contre les attaques par timing&lt;/p&gt;
&lt;p&gt;Si la signature ne correspond pas &#8594; `JWTSignatureError`.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; RSA (RS256 / RS384 / RS512)&lt;br class='autobr' /&gt;
Chargement de la cl&#233; publique PEM&lt;br class='autobr' /&gt;
V&#233;rification via `cryptography` + PKCS#1 v1.5&lt;/p&gt;
&lt;p&gt;Si la signature est invalide &#8594; `JWTSignatureError`.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; 5) Retour du payload&lt;br class='autobr' /&gt;
Si tout est correct, la fonction renvoie le **payload d&#233;cod&#233;** (dict Python).&lt;/p&gt;
&lt;p&gt;Voici le code :&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_python code&#034;&gt;&lt;div class=&#034;python&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# jwt_validation.py&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# coding: utf8&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034; &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;D&#233;codage et validation d'un Jeton d'Identit&#233; JSON Web Token (JWT).&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;Auteur : &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; B.Degoy bertrand@degoy.com &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;copyright (c) 2026 B.Degoy&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;licence : MIT&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; json&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;base64&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; hashlib&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; typing &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; Any&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; Dict&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTDecodeError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;Base class for all JWT decoding errors.&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;pass&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTFormatError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;JWTDecodeError&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;Raised when the JWT structure is invalid.&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;pass&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTAlgorithmError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;JWTDecodeError&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;Raised when the algorithm is missing or not allowed.&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;pass&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTSignatureError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;JWTDecodeError&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;Raised when the signature is invalid.&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;pass&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTUtils:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; A static utility class providing low-level JWT decoding and signature&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; verification, equivalent to the provided PHP implementation but using&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Python exceptions instead of returning False.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; This class does NOT validate claims (exp, nbf, iss, etc.).&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; &#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Base64URL decoding&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; urlsafe_b64decode&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;data: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Decode a Base64URL string into raw bytes.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Adds required padding if missing.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; &#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; padding &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;=&#034;&lt;/span&gt; * &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&#034;color: #008000;&#034;&gt;len&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;data&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #ff4500;&#034;&gt;4&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;base64&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;data + padding&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;as&lt;/span&gt; e:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTFormatError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid Base64URL segment: {data}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; e&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# HMAC signing&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; sign&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;message: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Compute an HMAC signature for the given message using HS256/384/512.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; &#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS256&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashlib.&lt;span style=&#034;color: black;&#034;&gt;sha256&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS384&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashlib.&lt;span style=&#034;color: black;&#034;&gt;sha384&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS512&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashlib.&lt;span style=&#034;color: black;&#034;&gt;sha512&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTAlgorithmError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Unsupported HMAC algorithm: {algo}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Constant-time comparison&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; hash_equals&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; b: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;bool&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;Constant-time comparison to avoid timing attacks.&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;compare_digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; b&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# RSA signature verification&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; verify_rsa&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;signature: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key_pem: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;bool&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Verify an RSA signature using a PEM-encoded public key.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Supported algorithms: RS256, RS384, RS512.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; &#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; cryptography.&lt;span style=&#034;color: black;&#034;&gt;hazmat&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;primitives&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; serialization&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashes&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; cryptography.&lt;span style=&#034;color: black;&#034;&gt;hazmat&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;primitives&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;asymmetric&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; padding&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; public_key &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; serialization.&lt;span style=&#034;color: black;&#034;&gt;load_pem_public_key&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key_pem.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; hash_algo &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS256&#034;&lt;/span&gt;: hashes.&lt;span style=&#034;color: black;&#034;&gt;SHA256&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS384&#034;&lt;/span&gt;: hashes.&lt;span style=&#034;color: black;&#034;&gt;SHA384&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS512&#034;&lt;/span&gt;: hashes.&lt;span style=&#034;color: black;&#034;&gt;SHA512&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&#125;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;get&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; hash_algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;is&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTAlgorithmError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Unsupported RSA algorithm: {algo}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; public_key.&lt;span style=&#034;color: black;&#034;&gt;verify&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signature&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; padding.&lt;span style=&#034;color: black;&#034;&gt;PKCS1v15&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; hash_algo&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Signature verification dispatcher&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; verify_signature&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;signature: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; input_data: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key: Any&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Verify the signature for the given algorithm.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Raises JWTSignatureError on failure.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; &#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS256&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS384&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS512&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; key_bytes &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; key &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;isinstance&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt; key.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; expected &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;sign&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;input_data&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key_bytes&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;hash_equals&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;expected&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signature&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTSignatureError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid HMAC signature&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS256&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS384&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS512&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;verify_rsa&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;signature&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; input_data&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTSignatureError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid RSA signature&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTAlgorithmError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Unsupported or invalid signing algorithm: {algo}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Main decode function&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ----------------------------------------------------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; decode&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;jwt: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key: Any &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; allowed_algorithms: Any &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; Dict:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Decode a JWT token, validate its structure, optionally verify its&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; signature, and return the payload as a dictionary.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Raises:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; JWTFormatError: Invalid structure or Base64URL segments.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; JWTAlgorithmError: Missing or disallowed algorithm.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; JWTSignatureError: Signature verification failed.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; &#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Basic structure check&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;.&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; jwt:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTFormatError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;JWT must contain at least one dot&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; parts &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; jwt.&lt;span style=&#034;color: black;&#034;&gt;split&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;.&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;len&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;parts&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;!=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;3&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTFormatError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;JWT must contain exactly 3 segments&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; head_b64&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; payload_b64&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; sig_b64 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; parts&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Decode JSON header and payload&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; header &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; json.&lt;span style=&#034;color: black;&#034;&gt;loads&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;head_b64&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;as&lt;/span&gt; e:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTFormatError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid JWT header&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; e&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; payload &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; json.&lt;span style=&#034;color: black;&#034;&gt;loads&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;payload_b64&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;as&lt;/span&gt; e:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTFormatError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid JWT payload&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; e&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signature &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;sig_b64&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Algorithm checks&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; allowed_algorithms:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;alg&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; header:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTAlgorithmError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Missing 'alg' in JWT header&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; header&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;alg&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;isinstance&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;allowed_algorithms&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;list&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;and&lt;/span&gt; algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; allowed_algorithms:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTAlgorithmError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Algorithm '{algo}' not allowed&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signing_input &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;{head_b64}.{payload_b64}&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;verify_signature&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;signature&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signing_input&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; payload&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/a9d3d6a214dd72fdbcb7dc13d3865678.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Validation des d&#233;clarations (claims)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;L'utilitaire ci-dessus d&#233;code le JWT et v&#233;rifie la signature &#8212; mais **il ne valide pas les claims**, c'est&#8209;&#224;&#8209;dire les champs qui d&#233;finissent *quand* et *dans quelles conditions* le token est valable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Quels claims doivent &#234;tre valid&#233;s ?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Les principaux champs standardis&#233;s dans un JWT sont :&lt;/p&gt;
&lt;table class=&#034;spip&#034;&gt;
&lt;tbody&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td&gt;Claim&lt;/td&gt;
&lt;td&gt;Signification&lt;/td&gt;
&lt;td&gt;Validation&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td&gt;`exp`&lt;/td&gt;
&lt;td&gt;Expiration time&lt;/td&gt;
&lt;td&gt;Le token doit &#234;tre encore valide&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td&gt;`nbf`&lt;/td&gt;
&lt;td&gt;Not Before&lt;/td&gt;
&lt;td&gt;Le token ne doit pas &#234;tre utilis&#233; trop t&#244;t&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td&gt;`iat`&lt;/td&gt;
&lt;td&gt;Issued At&lt;/td&gt;
&lt;td&gt;Optionnel : v&#233;rifier que la date n'est pas aberrante&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td&gt;`iss`&lt;/td&gt;
&lt;td&gt;Issuer&lt;/td&gt;
&lt;td&gt;V&#233;rifier que le token vient du bon &#233;metteur&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td&gt;`aud`&lt;/td&gt;
&lt;td&gt;Audience&lt;/td&gt;
&lt;td&gt;V&#233;rifier que le token est destin&#233; &#224; ton service&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td&gt;`sub`&lt;/td&gt;
&lt;td&gt;Subject&lt;/td&gt;
&lt;td&gt;Optionnel : v&#233;rifier l'identit&#233; attendue&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Fonction validate_claims()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Voici comment ajouter cette validation :&lt;br class='autobr' /&gt;
On ajoute une fonction **validate_claims(payload, options)** qui :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; lit les champs du payload,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; compare avec l'heure actuelle,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; l&#232;ve des exceptions explicites si quelque chose ne va pas.&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_python code&#034;&gt;&lt;div class=&#034;python&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;datetime&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;datetime&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; timezone&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTClaimsError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;Raised when JWT claims validation fails.&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;pass&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTUtils:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# ... (tout le reste de ta classe ici)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; validate_claims&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; payload: &lt;span style=&#034;color: #008000;&#034;&gt;dict&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; issuer: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; audience: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; leeway: &lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Validate standard JWT claims (exp, nbf, iss, aud).&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Parameters:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; payload (dict): The decoded JWT payload.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; issuer (str|None): Expected 'iss' value.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; audience (str|None): Expected 'aud' value.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; leeway (int): Allowed clock skew in seconds.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; Raises:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; JWTClaimsError: If any claim is invalid.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt; &#034;&#034;&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; now &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;datetime&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;now&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;timezone.&lt;span style=&#034;color: black;&#034;&gt;utc&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;timestamp&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# --- exp: expiration time ---&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;exp&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; payload:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; now &lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; payload&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;exp&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt; + leeway:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTClaimsError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Token has expired&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# --- nbf: not before ---&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;nbf&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; payload:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; now &lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt; payload&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;nbf&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt; - leeway:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTClaimsError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Token is not yet valid (nbf)&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# --- iat: issued at ---&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;iat&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; payload:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; payload&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;iat&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; now + leeway:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTClaimsError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Token issued in the future (iat)&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# --- iss: issuer ---&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; issuer &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;is&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; payload.&lt;span style=&#034;color: black;&#034;&gt;get&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;iss&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;!=&lt;/span&gt; issuer:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTClaimsError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid issuer: {payload.get('iss')}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# --- aud: audience ---&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; audience &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;is&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; aud &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; payload.&lt;span style=&#034;color: black;&#034;&gt;get&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;aud&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;isinstance&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;aud&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;list&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; audience &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; aud:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTClaimsError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Audience '{audience}' not allowed&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; aud &lt;span style=&#034;color: #66cc66;&#034;&gt;!=&lt;/span&gt; audience:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; JWTClaimsError&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Invalid audience: {aud}&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt;/python&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: black;&#034;&gt;&#123;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&#123;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;int&lt;/span&gt;&#233;gration dans `decode&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;`&lt;span style=&#034;color: black;&#034;&gt;&#125;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;On ajoute un param&#232;tre optionnel :&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt;&lt;span style=&#034;color: #dc143c;&#034;&gt;code&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;python&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;@&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;staticmethod&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; decode&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;jwt&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; allowed_algorithms&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; validate&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; issuer&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; audience&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; payload &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; ... &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# comme avant&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; validate:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;validate_claims&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;payload&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; issuer&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;issuer&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; audience&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;audience&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; payload&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt;/python&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;Et on l'appelle comme ceci :&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;&lt;&lt;/span&gt;&lt;span style=&#034;color: #dc143c;&#034;&gt;code&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;python&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;payload &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; JWTUtils.&lt;span style=&#034;color: black;&#034;&gt;decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;token&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; key&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;public_key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; allowed_algorithms&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS256&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; validate&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; issuer&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;https://auth.example.com&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; audience&lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;my-api&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/66a49d5836a68dfc502a9133df866516.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>Validation du jeton d'identit&#233; ID Token (JWT sign&#233; ou JWS)</title>
		<link>https://static.oa.dnc.global/-OpenID-Connect-6-.html#validationdujetondidentiteidtokenjwtsigneoujws</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-OpenID-Connect-6-.html#validationdujetondidentiteidtokenjwtsigneoujws</guid>
		<dc:date>2026-02-13T07:23:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;Les Jetons d'identit&#233; ne doivent jamais &#234;tre approuv&#233;s tels quels. Les jetons peuvent &#234;tre r&#233;utilis&#233;s par un malware, intercept&#233;s ou falsifi&#233;s par des attaquants. Lorsqu'une application ou une ressource prot&#233;g&#233;e re&#231;oit un jeton d'Identit&#233; JWT, elle doit toujours le valider. Cependant, valider le jeton n'est pas tout : il faut encore v&#233;rifier qu'il est pr&#233;sent&#233; par une application qui le d&#233;tient l&#233;gitimement. &lt;br class='autobr' /&gt;
Probl&#233;matique &lt;br class='autobr' /&gt;
Le jeton d'identit&#233;, de type JWT sign&#233; (JWS), doit &#234;tre valid&#233; dans deux situations : (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-OpenID-Connect-6-.html" rel="directory"&gt;OpenID Connect&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L93xH94/arton53-c518a.png?1733819613' width='93' height='94' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;Les Jetons d'identit&#233; ne doivent jamais &#234;tre approuv&#233;s tels quels. Les jetons peuvent &#234;tre r&#233;utilis&#233;s par un malware, intercept&#233;s ou falsifi&#233;s par des attaquants. Lorsqu'une application ou une ressource prot&#233;g&#233;e re&#231;oit un jeton d'Identit&#233; JWT, elle doit toujours le valider.&lt;br class='autobr' /&gt;
Cependant, valider le jeton n'est pas tout : il faut encore v&#233;rifier qu'il est pr&#233;sent&#233; par une application qui le d&#233;tient l&#233;gitimement.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Probl&#233;matique&lt;/h3&gt;
&lt;p&gt;Le jeton d'identit&#233;, de type JWT sign&#233; (JWS), doit &#234;tre valid&#233; dans deux situations :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; D&#232;s sa r&#233;ception, conform&#233;ment &#224; ce qui est d&#233;fini dans la sp&#233;cification d'OpenID Connect&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb1' class='spip_note' rel='appendix' title='Voici pourtant ce que dit Google : &#034;Normalement, il est essentiel de (...)' id='nh1'&gt;1&lt;/a&gt;]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Pour autoriser l'acc&#232;s &#224; une ressource prot&#233;g&#233;e. Voyez comment le probl&#232;me se pose de fa&#231;on g&#233;n&#233;rale : &lt;a href='https://static.oa.dnc.global/-OAuth-2-0-.html#validationdujetonparuneressourceprotegee' class='spip_in'&gt;Validation du jeton par une ressource prot&#233;g&#233;e&lt;/a&gt;. &lt;br class='autobr' /&gt;
Deux cas se pr&#233;sentent :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; soit on passe la cl&#233; publique au serveur de ressource prot&#233;g&#233;e RS qui proc&#232;de localement &#224; sa validation ; si ce RS n'est pas li&#233; &#224; l'organisation qui contr&#244;le le serveur d'authentification, il peut utiliser la fonction &lt;a href='https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectdecouverte' class='spip_in'&gt;API OpenID Connect : D&#233;couverte&lt;/a&gt;,
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; soit on utilise une m&#233;thode dite &#034;introspection&#034; consistant &#224; demander l'authentification du jeton JWT au serveur d'authentification qui l'a d&#233;livr&#233; : &lt;a href='https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectintrospectionintrospectionendpoint' class='spip_in'&gt;API Open ID Connect : Introspection (Introspection Endpoint)&lt;/a&gt; .&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Proc&#233;dure pour la Validation et la Consommation du jeton JWT sign&#233; (JWS)&lt;/h3&gt;
&lt;p&gt;La validation d'un jeton d'identit&#233; n&#233;cessite plusieurs &#233;tapes. Que le jeton soit valid&#233; du c&#244;t&#233; du serveur d'authentification ou &#224; distance, la m&#233;thode est la m&#234;me.&lt;/p&gt;
&lt;p&gt;Le d&#233;codage et la validation du jeton suivent la m&#233;thode d&#233;finie ici : &lt;a href=&#034;http://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation&#034; class='spip_out' rel='external'&gt;Sp&#233;cification OpenID Connect : Validation du jeton d'identit&#233;&lt;/a&gt; :&lt;/p&gt;
&lt;blockquote class=&#034;spip&#034;&gt;
&lt;p&gt;Les clients DOIVENT valider le jeton ID dans la r&#233;ponse au jeton de la mani&#232;re suivante :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si le jeton d'identification est chiffr&#233;, d&#233;chiffrez-le &#224; l'aide des cl&#233;s et des algorithmes sp&#233;cifi&#233;s lors de l'enregistrement par le client, que l'OP devait utiliser pour chiffrer le jeton d'identification. Si le chiffrement a &#233;t&#233; n&#233;goci&#233; avec l'OP au moment de l'enregistrement et que le jeton d'identification n'est pas chiffr&#233;, le RP&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb2' class='spip_note' rel='appendix' title='Relying Party : l'application cliente ou le serveur de ressource prot&#233;g&#233;e (...)' id='nh2'&gt;2&lt;/a&gt;]&lt;/span&gt; DEVRAIT le rejeter.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; L'identifiant de l'&#233;metteur pour le fournisseur OpenID (qui est g&#233;n&#233;ralement obtenu lors de la d&#233;couverte) DOIT correspondre exactement &#224; la valeur de la d&#233;claration iss (issuer).
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Le client DOIT valider que la d&#233;claration aud (audience) contienne la valeur client_id enregistr&#233;e aupr&#232;s de l'&#233;metteur identifi&#233; par la d&#233;claration iss (&#233;metteur) en tant qu'audience. La d&#233;claration aud (audience) PEUT contenir un tableau avec plus d'un &#233;l&#233;ment. Le jeton ID DOIT &#234;tre rejet&#233; si le jeton ID ne r&#233;pertorie pas le client en tant qu'audience valide, ou s'il contient des audiences suppl&#233;mentaires non approuv&#233;es par le client.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si le jeton d'identification contient plusieurs audiences, le client DEVRAIT v&#233;rifier qu'une d&#233;claration azp est pr&#233;sente.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si une d&#233;claration azp (partie autoris&#233;e) est pr&#233;sente, le client DEVRAIT v&#233;rifier que son client_id est la valeur de la d&#233;claration.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si le jeton ID est re&#231;u via une communication directe entre le client et le point d'extr&#233;mit&#233; du jeton (qui se trouve dans ce flux), la validation TLS du serveur PEUT &#234;tre utilis&#233;e pour valider l'&#233;metteur au lieu de v&#233;rifier la signature du jeton&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb3' class='spip_note' rel='appendix' title='Autrement dit, si la liaison entre le client et le serveur est s&#233;curis&#233;e par (...)' id='nh3'&gt;3&lt;/a&gt;]&lt;/span&gt;. Le client DOIT valider la signature de tous les autres jetons ID conform&#233;ment &#224; JWS [JWS] en utilisant l'algorithme sp&#233;cifi&#233; dans le param&#232;tre d'en-t&#234;te JWT alg. Le client DOIT utiliser les cl&#233;s fournies par l'&#233;metteur.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; La valeur alg DEVRAIT &#234;tre la valeur par d&#233;faut de RS256 ou l'algorithme envoy&#233; par le client dans le param&#232;tre id_token_signed_response_alg lors de l'enregistrement.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si le param&#232;tre d'en-t&#234;te JWT alg utilise un algorithme bas&#233; sur MAC, tel que HS256, HS384 ou HS512, les octets de la repr&#233;sentation UTF-8 du secret client correspondant &#224; l'identifiant client contenu dans la d&#233;claration aud (audience) sont utilis&#233;s comme cl&#233; de validation de la signature. Pour les algorithmes bas&#233;s sur MAC, le comportement n'est pas sp&#233;cifi&#233; si l'aud est multivalu&#233; ou si une valeur azp est diff&#233;rente de la valeur aud.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; L'heure actuelle DOIT &#234;tre ant&#233;rieure &#224; l'heure repr&#233;sent&#233;e par la d&#233;claration exp.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; La d&#233;claration Iat peut &#234;tre utilis&#233; pour rejeter des jetons qui ont &#233;t&#233; &#233;mis trop loin de l'heure actuelle, limitant ainsi la dur&#233;e de stockage des cl&#233;s pour pr&#233;venir les attaques. La plage acceptable est sp&#233;cifique au client.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si une valeur &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#nonce' class='spip_in'&gt;nonce&lt;/a&gt; a &#233;t&#233; envoy&#233;e dans la demande d'authentification, une d&#233;claration de nonce DOIT &#234;tre pr&#233;sente et sa valeur v&#233;rifi&#233;e pour contr&#244;ler qu'il s'agit de la m&#234;me valeur que celle qui a &#233;t&#233; envoy&#233;e dans la demande d'authentification. Le client DEVRAIT v&#233;rifier la valeur de nonce pour les attaques par relecture. La m&#233;thode pr&#233;cise pour d&#233;tecter les attaques par relecture est sp&#233;cifique au client.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si la d&#233;claration acr a &#233;t&#233; mentionn&#233;e, le client DEVRAIT v&#233;rifier que la valeur de r&#233;clamation revendiqu&#233;e est appropri&#233;e. La signification et le traitement des d&#233;clarations acr sont hors du domaine d'application de la pr&#233;sente sp&#233;cification.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Si la d&#233;claration auth_time a &#233;t&#233; mentionn&#233;e, par le biais d'une demande sp&#233;cifique pour cette d&#233;claration ou du param&#232;tre max_age, le client DEVRAIT v&#233;rifier la valeur de la d&#233;claration auth_time et demander une nouvelle authentification s'il d&#233;termine qu'il s'est &#233;coul&#233; trop de temps depuis la derni&#232;re authentification de l'utilisateur final.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Exemple de code pour la v&#233;rification locale de la signature du jeton d'identit&#233; JWT sign&#233; (JWS)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;La plupart de ces v&#233;rifications ne n&#233;cessitent qu'une simple comparaison de cha&#238;nes. La validation de la signature est plus complexe. L'impl&#233;mentation qui en est faite par OAuthSD est d&#233;crite maintenant. La fonction suivante, tir&#233;e de &lt;a href=&#034;https://bshaffer.github.io/oauth2-server-php-docs/&#034; class='spip_out' rel='external'&gt;OAuth 2.0 Server PHP&lt;/a&gt;, s&#233;pare les composantes du jeton, d&#233;tecte les erreurs de format, v&#233;rifie &#233;ventuellement la signature et retourne la charge utile ou false en cas d'erreur.&lt;/p&gt;
&lt;p&gt;La variable $key passe la cl&#233; publique qui a servi &#224; g&#233;n&#233;rer le jeton JWT.&lt;/p&gt;
&lt;p&gt;Si $key = null, la v&#233;rification de la signature n'est pas effectu&#233;e (on suppose le jeton d&#233;j&#224; valid&#233; par introspection), et le contenu de la charge utile est retourn&#233; sous la forme d'un tableau associatif.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PHP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;* @author Brent Shaffer &lt;bshafs at gmail dot com&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * @license MIT License&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * S&#233;pare les composantes du jeton, d&#233;tecte les erreurs de format, v&#233;rifie la signature et retourne la charge utile ou false en cas d'erreur.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * @param mixed $jwt : le jeton JWT&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * @param mixed $key : la cl&#233; publique&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * @param mixed $allowedAlgorithms : un array des codes d'algorithmes autoris&#233;s (sous ensemble de HS256, HS384 ou HS512, RS256, RS384 et RS512). Si ce param&#232;tre est pr&#233;cis&#233;, le jeton doit indiquer l'algorithme et celui-ci doit &#234;tre compris dans l'array.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * @param mixed return : charge utile (tableau associatif) ou false.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; */&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;function&lt;/span&gt; decode&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$jwt&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;null&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$allowedAlgorithms&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;!&lt;/span&gt;&lt;a href=&#034;http://www.php.net/strpos&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;strpos&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$jwt&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'.'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$tks&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/explode&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;explode&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'.'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$jwt&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&#034;http://www.php.net/count&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;count&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$tks&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;!=&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;3&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/list&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;list&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$headb64&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$payloadb64&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$cryptob64&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$tks&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;null&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;===&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$header&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/json_decode&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;json_decode&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$this&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;-&gt;&lt;/span&gt;&lt;span style=&#034;color: #004000;&#034;&gt;urlSafeB64Decode&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$headb64&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;null&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;===&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$payload&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/json_decode&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;json_decode&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$this&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;-&gt;&lt;/span&gt;&lt;span style=&#034;color: #004000;&#034;&gt;urlSafeB64Decode&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$payloadb64&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$sig&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$this&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;-&gt;&lt;/span&gt;&lt;span style=&#034;color: #004000;&#034;&gt;urlSafeB64Decode&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$cryptob64&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;bool&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$allowedAlgorithms&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;!&lt;/span&gt;&lt;a href=&#034;http://www.php.net/isset&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$header&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'alg'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// check if bool arg supplied here to maintain BC&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&#034;http://www.php.net/is_array&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;is_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$allowedAlgorithms&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;&amp;&amp;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;!&lt;/span&gt;&lt;a href=&#034;http://www.php.net/in_array&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;in_array&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$header&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'alg'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$allowedAlgorithms&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;!&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$this&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;-&gt;&lt;/span&gt;&lt;span style=&#034;color: #004000;&#034;&gt;verifySignature&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$sig&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;&lt;span style=&#034;color: #006699; font-weight: bold;&#034;&gt;$headb64&lt;/span&gt;.&lt;span style=&#034;color: #006699; font-weight: bold;&#034;&gt;$payloadb64&lt;/span&gt;&#034;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$header&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'alg'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$payload&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;function&lt;/span&gt; verifySignature&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$signature&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$input&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$algo&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'HS256'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// use constants when possible, for HipHop support&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;switch&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$algo&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;case&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'HS256'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;case&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'HS384'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;case&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'HS512'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$this&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;-&gt;&lt;/span&gt;&lt;span style=&#034;color: #004000;&#034;&gt;hash_equals&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$this&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;-&gt;&lt;/span&gt;&lt;span style=&#034;color: #004000;&#034;&gt;sign&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$input&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$algo&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$signature&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;case&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'RS256'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;a href=&#034;http://www.php.net/openssl_verify&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;openssl_verify&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$input&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$signature&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;a href=&#034;http://www.php.net/defined&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;defined&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'OPENSSL_ALGO_SHA256'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; ? OPENSSL_ALGO_SHA256 &lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'sha256'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;===&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;case&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'RS384'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;@&lt;/span&gt;&lt;a href=&#034;http://www.php.net/openssl_verify&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;openssl_verify&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$input&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$signature&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;a href=&#034;http://www.php.net/defined&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;defined&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'OPENSSL_ALGO_SHA384'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; ? OPENSSL_ALGO_SHA384 &lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'sha384'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;===&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;case&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'RS512'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;@&lt;/span&gt;&lt;a href=&#034;http://www.php.net/openssl_verify&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;openssl_verify&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$input&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$signature&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;a href=&#034;http://www.php.net/defined&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;defined&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'OPENSSL_ALGO_SHA512'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; ? OPENSSL_ALGO_SHA512 &lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'sha512'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;===&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;default&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;throw&lt;/span&gt; &lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;new&lt;/span&gt; \InvalidArgumentException&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;Unsupported or invalid signing algorithm.&#034;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/f60929015b36926971323ab17c8e7fb1.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Voici un autre exemple en Python :&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_python code&#034;&gt;&lt;div class=&#034;python&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; json&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;base64&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; hashlib&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; typing &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; Any&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; Dict&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; Optional&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;class&lt;/span&gt; JWTDecoder:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Base64URL decode&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; urlsafe_b64decode&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; data: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; padding &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;'='&lt;/span&gt; * &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&#034;color: #008000;&#034;&gt;len&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;data&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; % &lt;span style=&#034;color: #ff4500;&#034;&gt;4&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;base64&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;data + padding&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# HMAC signature&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; sign&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS256&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashlib.&lt;span style=&#034;color: black;&#034;&gt;sha256&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS384&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashlib.&lt;span style=&#034;color: black;&#034;&gt;sha384&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS512&#034;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: #dc143c;&#034;&gt;new&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashlib.&lt;span style=&#034;color: black;&#034;&gt;sha512&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;ValueError&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Unsupported HMAC algorithm&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Constant&#8209;time comparison&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; hash_equals&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; a: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; b: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;bool&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;hmac&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;compare_digest&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;a&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; b&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# RSA signature verification&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; verify_rsa&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signature: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; message: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key_pem: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;bool&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; cryptography.&lt;span style=&#034;color: black;&#034;&gt;hazmat&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;primitives&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; serialization&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; hashes&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;from&lt;/span&gt; cryptography.&lt;span style=&#034;color: black;&#034;&gt;hazmat&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;primitives&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;asymmetric&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;import&lt;/span&gt; padding&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; public_key &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; serialization.&lt;span style=&#034;color: black;&#034;&gt;load_pem_public_key&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key_pem.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; hash_algo &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS256&#034;&lt;/span&gt;: hashes.&lt;span style=&#034;color: black;&#034;&gt;SHA256&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS384&#034;&lt;/span&gt;: hashes.&lt;span style=&#034;color: black;&#034;&gt;SHA384&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS512&#034;&lt;/span&gt;: hashes.&lt;span style=&#034;color: black;&#034;&gt;SHA512&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&#125;&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;get&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; hash_algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;is&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;ValueError&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Unsupported RSA algorithm&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; public_key.&lt;span style=&#034;color: black;&#034;&gt;verify&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signature&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; message.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; padding.&lt;span style=&#034;color: black;&#034;&gt;PKCS1v15&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; hash_algo&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Signature verification&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; verify_signature&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signature: &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; input_data: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key: Any&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;bool&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS256&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS384&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;HS512&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;hash_equals&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;sign&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;input_data&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;isinstance&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #dc143c;&#034;&gt;bytes&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;else&lt;/span&gt; key.&lt;span style=&#034;color: black;&#034;&gt;encode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signature&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; &lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS256&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS384&#034;&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;RS512&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;verify_rsa&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;signature&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; input_data&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;raise&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;ValueError&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;Unsupported or invalid signing algorithm.&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Main decode function&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# -----------------------------&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;def&lt;/span&gt; decode&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; jwt: &lt;span style=&#034;color: #008000;&#034;&gt;str&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key: Optional&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;Any&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;None&lt;/span&gt;&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; allowed_algorithms: Any &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;True&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; -&lt;span style=&#034;color: #66cc66;&#034;&gt;&gt;&lt;/span&gt; Optional&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;Dict&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;.&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; jwt:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; parts &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; jwt.&lt;span style=&#034;color: black;&#034;&gt;split&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;.&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;len&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;parts&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #66cc66;&#034;&gt;!=&lt;/span&gt; &lt;span style=&#034;color: #ff4500;&#034;&gt;3&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; head_b64&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; payload_b64&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; sig_b64 &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; parts&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; header &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; json.&lt;span style=&#034;color: black;&#034;&gt;loads&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;head_b64&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; payload &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; json.&lt;span style=&#034;color: black;&#034;&gt;loads&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;payload_b64&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;except&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;Exception&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signature &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;urlsafe_b64decode&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;sig_b64&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #808080; font-style: italic;&#034;&gt;# Algorithm checks&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; allowed_algorithms:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;alg&#034;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; header:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; algo &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; header&lt;span style=&#034;color: black;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;alg&#034;&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;isinstance&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;allowed_algorithms&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;list&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;and&lt;/span&gt; algo &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;in&lt;/span&gt; allowed_algorithms:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; signing_input &lt;span style=&#034;color: #66cc66;&#034;&gt;=&lt;/span&gt; f&lt;span style=&#034;color: #483d8b;&#034;&gt;&#034;{head_b64}.{payload_b64}&#034;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;not&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;self&lt;/span&gt;.&lt;span style=&#034;color: black;&#034;&gt;verify_signature&lt;/span&gt;&lt;span style=&#034;color: black;&#034;&gt;&amp;#40;&lt;/span&gt;signature&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; signing_input&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; key&lt;span style=&#034;color: #66cc66;&#034;&gt;,&lt;/span&gt; algo&lt;span style=&#034;color: black;&#034;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #008000;&#034;&gt;False&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #ff7700;font-weight:bold;&#034;&gt;return&lt;/span&gt; payload&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/70d0a7b3f245dcb3aab2809fbe764de9.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;h3 class=&#034;spip&#034;&gt;Avertissement &#224; propos du param&#232;tre 'alg'&lt;/h3&gt;
&lt;p&gt;La sp&#233;cification pr&#233;voit d'appliquer la valeur du param&#232;tre 'alg' pour le choix de l'algorithme de validation de la signature : RFC 7515, section 4.1.1. : &#034;... This Header Parameter MUST be present and MUST be understood and processed by implementations ...&#034;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;C'est une faille de s&#233;curit&#233;&lt;/strong&gt;, et donc une erreur de la sp&#233;cification. OAuthSD applique la m&#233;thode d&#233;finie pour chaque application, quelle que soit la valeur de alg. Il est int&#233;ressant de constater que &lt;a href=&#034;https://oa.dnc.global/-Tests-et-certification-.html&#034; class='spip_out' rel='external'&gt;OAuthSD passe les tests de validation de l'OIDF&lt;/a&gt; comme cela.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;En savoir plus sur la validation du JWT :&lt;/h3&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;a href='https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectintrospectionintrospectionendpoint' class='spip_in'&gt;API Open ID Connect : Introspection (Introspection Endpoint)&lt;/a&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;a href='https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectpointdextremitedinformationssurlesclefskeysendpoint' class='spip_in'&gt;API OpenId Connect : Point d'extr&#233;mit&#233; d'informations sur les clefs (Keys Endpoint)&lt;/a&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;a href='https://static.oa.dnc.global/-OpenID-Connect-Autorisation-via-un-code-Authorization-Code-Flow-.html#openidconnectexemplescompletsdufluxdautorisationviauncodepuisrequeteuserinfo' class='spip_in'&gt;OpenID Connect : Exemples complets du flux d'Autorisation via un code puis requ&#234;te UserInfo&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Voyez &#233;galement :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;a href='https://static.oa.dnc.global/-Gestion-du-jeton-d-acces-.html#validationdujetondaccesavecladeclarationat_hashdujetondidentite' class='spip_in'&gt;Validation du jeton d'acc&#232;s avec la d&#233;claration at_hash du jeton d'identit&#233;&lt;/a&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;a href='https://static.oa.dnc.global/-Techniques-et-code-du-serveur-OAuthSD-.html#tableusers' class='spip_in'&gt;Table Users&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Notons que la validation du jeton ne suffit pas au serveur de ressource pour &lt;strong&gt;s'assurer que l'application qui pr&#233;sente le jeton le d&#233;tient l&#233;gitimement&lt;/strong&gt; et &#233;viter de r&#233;pondre &#224; une application &#233;trang&#232;re. Voir &#224; ce sujet : &lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;a href='https://static.oa.dnc.global/-Authentifier-l-application-.html#verificationdeloriginedelarequeterecueparunserveurderessource' class='spip_in'&gt;V&#233;rification de l'origine de la requ&#234;te re&#231;ue par un serveur de ressource&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
		&lt;hr /&gt;
		&lt;div class='rss_notes'&gt;&lt;div id='nb1'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh1' class='spip_note' title='Notes 1' rev='appendix'&gt;1&lt;/a&gt;] &lt;/span&gt;Voici pourtant ce que dit Google : &#034;Normalement, il est essentiel de valider un jeton d'identification avant de l'utiliser, mais puisque vous communiquez directement avec Google via un canal HTTPS sans interm&#233;diaire et que vous utilisez le secret de votre client pour vous authentifier aupr&#232;s de Google, vous pouvez &#234;tre s&#251;r que le jeton que vous recevez vient vraiment de Google et est valide.&#034; C'est &#224; dire que le jeton peut &#234;tre n'importe quoi, une tartine, un cafard ou un cheval, du moment que l'on a une r&#233;ponse c'est bon !!! Autant dire que le jeton ne sert &#224; rien. Tiens, on reconnait l&#224; l'erreur qui avait pr&#233;valu avec le jeton d'acc&#232;s d'OAuth 2.0. Heureusement il y a la suite : &#034;Si votre serveur transmet le jeton d'identification &#224; d'autres composants de votre application, il est extr&#234;mement important que les autres composants le valident avant de l'utiliser. &#034; (&lt;a href=&#034;https://developers.google.com/identity/protocols/OpenIDConnect#validatingtoken&#034; class='spip_url spip_out' rel='external'&gt;https://developers.google.com/ident...&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb2'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh2' class='spip_note' title='Notes 2' rev='appendix'&gt;2&lt;/a&gt;] &lt;/span&gt;Relying Party : l'application cliente ou le serveur de ressource prot&#233;g&#233;e etc..&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb3'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh3' class='spip_note' title='Notes 3' rev='appendix'&gt;3&lt;/a&gt;] &lt;/span&gt;Autrement dit, si la liaison entre le client et le serveur est s&#233;curis&#233;e par TLS, on pourrait se passer de valider la signature. C'est ce que dit Google ici : &lt;a href=&#034;https://developers.google.com/identity/protocols/OpenIDConnect#validatingtoken&#034; class='spip_url spip_out' rel='external'&gt;https://developers.google.com/ident...&lt;/a&gt; . Cependant, nous consid&#233;rons qu'il faut toujours valider la signature du jeton quel que soit l'utilisation, et pas seulement dans le cas o&#249; le jeton est retransmis &#224; une application ou ressource tierce.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
		&lt;div class='rss_ps'&gt;&lt;p&gt;Voir aussi :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; &lt;a href=&#034;https://www.pingidentity.com/fr/company/blog/posts/2019/the-hard-parts-of-jwt-security-nobody-talks-about.html&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;https://www.pingidentity.com/fr/company/blog/posts/2019/the-hard-parts-of-jwt-security-nobody-talks-about.html&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>APACHE mod_auth_openidc</title>
		<link>https://static.oa.dnc.global/-Ressources-pour-les-developpeurs-.html#apachemod_auth_openidc</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-Ressources-pour-les-developpeurs-.html#apachemod_auth_openidc</guid>
		<dc:date>2024-11-07T13:55:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;APACHE mod_auth_openidc est un module d'authentification pour le serveur HTTP Apache 2.x qui d&#233;l&#232;gue l'authentification des utilisateurs &#224; un fournisseur OpenID Connect. Cela permet de contr&#244;ler l'acc&#232;s &#224; tout ou partie d'un domaine Web. &lt;br class='autobr' /&gt;
Il est ainsi possible d'acc&#233;der &#224; des applications sans avoir &#224; les modifier pour OIDC. &lt;br class='autobr' /&gt;
Ce module permet &#224; un serveur Web Apache 2.x de fonctionner en tant que partie de confiance OpenID Connect (RP) ou 'client' d'un fournisseur OpenID Connect (OP). &lt;br class='autobr' /&gt;
Il d&#233;l&#232;gue (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-Ressources-pour-les-developpeurs-.html" rel="directory"&gt;Adaptation des applications&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L150xH134/arton220-59307.png?1733820003' width='150' height='134' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;APACHE mod_auth_openidc est un module d'authentification pour le serveur HTTP Apache 2.x qui d&#233;l&#232;gue l'authentification des utilisateurs &#224; un fournisseur OpenID Connect. Cela permet de contr&#244;ler l'acc&#232;s &#224; tout ou partie d'un domaine Web.&lt;/p&gt;
&lt;p&gt;Il est ainsi possible d'acc&#233;der &#224; des applications sans avoir &#224; les modifier pour OIDC.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;p&gt;Ce module permet &#224; un serveur Web Apache 2.x de fonctionner en tant que partie de confiance OpenID Connect (RP) ou 'client' d'un fournisseur OpenID Connect (OP).&lt;/p&gt;
&lt;p&gt;Il d&#233;l&#232;gue l'authentification des utilisateurs &#224; l'OP, dont il re&#231;oit en retour un jeton d'identit&#233; (ID Token) contenant les informations d'identit&#233; de l'utilisateur. &lt;br class='autobr' /&gt;
Il transmet ces informations aux applications h&#233;berg&#233;es et prot&#233;g&#233;es par le serveur Web Apache.&lt;/p&gt;
&lt;p&gt;Le contenu et/ou les applications prot&#233;g&#233;s peuvent &#234;tre servis par le serveur Apache lui-m&#234;me ou peuvent &#234;tre servis depuis un autre endroit lorsqu'Apache est configur&#233; en tant que proxy inverse devant le(s) serveur(s) d'origine.&lt;/p&gt;
&lt;p&gt;See : &lt;a href=&#034;https://github.com/zmartzone/mod_auth_openidc&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;https://github.com/zmartzone/mod_auth_openidc&lt;/a&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Pr&#233;paration&lt;/h3&gt;
&lt;p&gt;Tout d'abord il faut v&#233;rifier la pr&#233;sence du module mod_auth_openidc :&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;# apachectl -M&lt;br /&gt; ...&lt;br /&gt; auth_openidc_module (shared)&lt;br /&gt; ...&lt;/code&gt;&lt;/div&gt; &lt;p&gt;Si absent, il faut installer le module mod_auth_openidc.so :&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;# yum install mod_auth_openidc&lt;br /&gt; ...&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;et relancer Apache.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Configurer un VirtualHost&lt;/h3&gt;
&lt;p&gt;Dans l'exemple qui suit, un serveur &#224; l'URL example.com comporte un r&#233;pertoire '/protected' prot&#233;g&#233; par OIDC.&lt;/p&gt;
&lt;p&gt;Il y a trois sections dans cet exemple : d'abord la d&#233;finition du serveur, puis la configuration OIDC et enfin la d&#233;finition d'un emplacement prot&#233;g&#233; par OIDC.&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;NameVirtualHost *:80&lt;br /&gt; &lt;br /&gt; &lt;VirtualHost *:80&gt;&lt;br /&gt; ServerAdmin webmaster@example.com&lt;br /&gt; ServerName example.com&lt;br /&gt; ServerAlias www.example.com&lt;br /&gt; DocumentRoot /home/example/public_html/&lt;br /&gt; DirectoryIndex index.html&lt;br /&gt; ErrorLog /var/log/oidc/error.log&lt;br /&gt; CustomLog /var/log/oidc/access.log&lt;br /&gt; &lt;br /&gt; OIDCProviderMetadataURL https://oa.dnc.global/.well-known/openid-configuration&lt;br /&gt; OIDCClientID openidc_example&lt;br /&gt; OIDCClientSecret ...&lt;br /&gt; OIDCRedirectURI http://example.com/protected/redirect_uri&lt;br /&gt; OIDCCryptoPassphrase &lt;password&gt;&lt;br /&gt; OIDCJWKSRefreshInterval 3600&lt;br /&gt; &lt;br /&gt; &lt;Location /protected/&gt;&lt;br /&gt; AuthType openid-connect&lt;br /&gt; Require valid-user&lt;br /&gt; &lt;/Location&gt;&lt;br /&gt; &lt;br /&gt; &lt;/VirtualHost&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OIDCProviderMetadataURL : URL du document de d&#233;couverte (Discovery metadata). Par convention il s'agit du fichier openid-configuration se trouvant &#224; la racine des documents de l'OP dans le r&#233;pertoire /.well-known/. &lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OIDCClientID, OIDCClientSecret : les identifiants du module en tant que client de l'OP (ou relying party, RP).
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OIDCRedirectURI : une URI factice qui doit pointer dans un r&#233;pertoire prot&#233;g&#233; par ce module (dans notre exemple &#224; l'int&#233;rieur du r&#233;pertoire 'protected') mais ne doit PAS pointer vers un contenu. Il faut l'enregistrer en tant qu'URI de redirection dans la configuration du client sur l'OP.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OIDCCryptoPassphrase : un mot de passe al&#233;atoire &#224; des fins de cryptage de la session.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OIDCJWKSRefreshInterval : Dur&#233;e de vie de l'authentification.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;D&#233;clarations renvoy&#233;es depuis OpenID Connect via le module Apache&lt;/h3&gt;
&lt;p&gt;Le module passe les d&#233;clarations du jeton d'identit&#233; ID_TOKEN aux applications h&#233;berg&#233;es et prot&#233;g&#233;es par le serveur web Apache.&lt;/p&gt;
&lt;p&gt;Par d&#233;faut, le module d&#233;finit la variable REMOTE_USER sur la revendication id_token [sub], concat&#233;n&#233;e avec l'identifiant de l'&#233;metteur de l'OP ([sub]@[iss]).&lt;/p&gt;
&lt;p&gt;Les autres d&#233;clarations du jeton d'identit&#233; ID_TOKEN sont transmises dans les en-t&#234;tes HTTP et/ou les variables d'environnement avec celles (&#233;ventuellement) obtenues &#224; partir du point de terminaison UserInfo.&lt;/p&gt;
&lt;p&gt;La super globale $_SERVER contient ces d&#233;clarations sous la forme :&lt;br class='autobr' /&gt;
&lt;code class='spip_code' dir='ltr'&gt;OIDC_XXX&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;On peut par exemple les lister comme suit :&lt;br class='autobr' /&gt;
&lt;strong&gt;PHP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #b1b100;&#034;&gt;foreach&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$_SERVER&lt;/span&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;as&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;=&gt;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$value&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;a href=&#034;http://www.php.net/preg_match&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;preg_match&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;/OIDC_/i&#034;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$key&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;echo&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;&lt;span style=&#034;color: #006699; font-weight: bold;&#034;&gt;$key&lt;/span&gt; : &lt;span style=&#034;color: #006699; font-weight: bold;&#034;&gt;$value&lt;/span&gt;&#034;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/c14292a2e185e5861872a1de693eda24.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;h3 class=&#034;spip&#034;&gt;Autorisation Apache Require&lt;/h3&gt;
&lt;p&gt;Les r&#232;gles d'autorisation Apache Require standard peuvent &#234;tre appliqu&#233;es avec l'ensemble des d&#233;clarations fournies par le jeton d'identit&#233;.&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>Gestion de la session OIDC : Fonctionnalit&#233;s</title>
		<link>https://static.oa.dnc.global/-OpenID-Connect-SSO-management-de-session-etc-.html#gestiondelasessionoidcfonctionnalites</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-OpenID-Connect-SSO-management-de-session-etc-.html#gestiondelasessionoidcfonctionnalites</guid>
		<dc:date>2024-04-28T10:33:30Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;SSO, SLI, SLO, SRA : ces fonctionnalit&#233;s offertes par OAuthSD simplifient la gestion des sessions et des connexions pour les utilisateurs, en garantissant une exp&#233;rience fluide et s&#233;curis&#233;e lors de l'utilisation d'applications multiples compatibles avec OpenID Connect. &lt;br class='autobr' /&gt;
Avant de d&#233;tailler comment OAuthSD met en &#339;uvre ces fonctionnalit&#233;s, assurons-nous de bien les distinguer : &lt;br class='autobr' /&gt; SSO (Single Sign-On) : Il s'agit d'un m&#233;canisme qui permet &#224; un utilisateur de se connecter une seule fois pour acc&#233;der &#224; (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-OpenID-Connect-SSO-management-de-session-etc-.html" rel="directory"&gt;OpenID Connect : SSO, management de session etc.&lt;/a&gt;


		</description>


 <content:encoded>&lt;div class='rss_chapo'&gt;&lt;p&gt;SSO, SLI, SLO, SRA : ces fonctionnalit&#233;s offertes par OAuthSD simplifient la gestion des sessions et des connexions pour les utilisateurs, en garantissant une exp&#233;rience fluide et s&#233;curis&#233;e lors de l'utilisation d'applications multiples compatibles avec OpenID Connect.&lt;/p&gt;
&lt;p&gt;Avant de d&#233;tailler comment OAuthSD met en &#339;uvre ces fonctionnalit&#233;s, assurons-nous de bien les distinguer :&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;p&gt;&lt;strong&gt;SSO (Single Sign-On)&lt;/strong&gt; : Il s'agit d'un m&#233;canisme qui permet &#224; un utilisateur de se connecter une seule fois pour acc&#233;der &#224; plusieurs applications, sans avoir &#224; se reconnecter &#224; chaque fois. Avec OAuthSD, le SSO est mis en place pour offrir une authentification unique pour un groupe d'applications, &#233;vitant ainsi &#224; un m&#234;me internaute de devoir s'authentifier plusieurs fois pour acc&#233;der &#224; des applications diff&#233;rentes.&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;SLI (Single Login In) &lt;/strong&gt; : Le SLI est un concept similaire au SSO, mais il se concentre sur le fait qu'une fois connect&#233;, un utilisateur peut acc&#233;der &#224; plusieurs applications sans avoir &#224; se reconnecter. OAuthSD utilise le SLI pour faciliter la navigation et l'&#233;change de donn&#233;es au sein d'une application multiple.&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;SLO (Single Log-Out) &lt;/strong&gt; : Le SLO est le pendant du SSO, mais pour la d&#233;connexion. Il permet &#224; un utilisateur de se d&#233;connecter une seule fois pour se d&#233;connecter de toutes les applications auxquelles il est connect&#233;. Cela garantit une d&#233;connexion globale et renforce la s&#233;curit&#233; en cas de d&#233;part de l'utilisateur de son poste de travail.&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;SRA (Single Re-Authentication) &lt;/strong&gt; : Le SRA est un m&#233;canisme qui permet &#224; un utilisateur de se r&#233;-authentifier de mani&#232;re transparente lorsqu'un cookie d'authentification n'est plus valide. Cela garantit une s&#233;curit&#233; renforc&#233;e en cas de besoin de r&#233;-authentification.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Cet article a &#233;t&#233; &#233;crit &#224; l'aide de &lt;a href=&#034;https://chat.i-tego.com&#034; class='spip_out' rel='external'&gt;i-Tego ChatBot&lt;/a&gt;, en r&#233;ponse &#224; la question : &#034;Dans le contexte d'OAuthSD, expliquer SSO, SLI, SLO, SRA.&#034;&lt;/i&gt;&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>OIDC et les Application &#224; page unique : exemple d'une belle mascarade !</title>
		<link>https://static.oa.dnc.global/-Authentifier-l-application-.html#oidcetlesapplicationapageuniqueexempledunebellemascarade</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-Authentifier-l-application-.html#oidcetlesapplicationapageuniqueexempledunebellemascarade</guid>
		<dc:date>2022-09-16T16:37:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;Une application &#224; page unique (SPA) est une application Web qui charge une seule page HTML &#224; partir du serveur Web, puis la met &#224; jour de mani&#232;re dynamique en r&#233;ponse &#224; l'interaction de l'utilisateur et &#224; d'autres &#233;v&#233;nements. &lt;br class='autobr' /&gt;
Tirant argument des progr&#232;s des navigateurs, permettant &#224; Javascript de mettre en &#339;uvre les r&#232;gles CORS et d'acc&#233;der au cryptage, certains pr&#233;conisent de mettre en &#339;uvre le flux de code avec autorisation plut&#244;t que le flux implicite. &lt;br class='autobr' /&gt;
La magie du flux &#034;Authorization Code&#034; est alors (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-Authentifier-l-application-.html" rel="directory"&gt;Authentifier l'application&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L150xH150/arton177-aabd3.png?1733820003' width='150' height='150' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;Une application &#224; page unique (SPA) est une application Web qui charge une seule page HTML &#224; partir du serveur Web, puis la met &#224; jour de mani&#232;re dynamique en r&#233;ponse &#224; l'interaction de l'utilisateur et &#224; d'autres &#233;v&#233;nements.&lt;/p&gt;
&lt;p&gt;Tirant argument des progr&#232;s des navigateurs, permettant &#224; Javascript de mettre en &#339;uvre les r&#232;gles CORS et d'acc&#233;der au cryptage, certains pr&#233;conisent de mettre en &#339;uvre le flux de code avec autorisation plut&#244;t que le flux implicite.&lt;/p&gt;
&lt;p&gt;La magie du flux &#034;Authorization Code&#034; est alors &#233;voqu&#233;e pour pr&#233;tendre que l'acc&#232;s aux donn&#233;es est s&#233;curis&#233;. Ce n'est que pure mascarade ! Bling bling bling ...&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Une application &#224; page unique est une application &#034;sans back-end&#034;&lt;/h3&gt;
&lt;p&gt;Plusieurs architectures permettent de cr&#233;er des applications &#224; page unique. La tendance est l'architecture &#034;serveur l&#233;ger&#034;, qui installe sur l'agent utilisateur ( en g&#233;n&#233;ral le navigateur de l'utilisateur ) la page initiale contenant du code Javascript. Ce code assurera la logique et les transitions d'&#233;tat de l'application, celle-ci obtenant ses donn&#233;es d'API RESTful prot&#233;g&#233;es par OAuth 2.0. Dans cette configuration, l'application r&#233;side sur l'agent utilisateur et non sur le serveur : une application &#224; page unique est donc une application &#034;sans back-end&#034;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Les SPA pourraient (maintenant ?) mettre en &#339;uvre le flux de code avec autorisation (Authorization Code Grant)&lt;/h3&gt;
&lt;p&gt;Il est de nombreuses configurations dans lesquelles les h&#244;tes de l'application et les points de terminaison des services se situent sur des serveurs diff&#233;rents : serveur d'authentification, ressources prot&#233;g&#233;es (RS) ou API.&lt;/p&gt;
&lt;p&gt;Les applications &#224; page unique en sont un bon exemple.&lt;/p&gt;
&lt;p&gt;En utilisation Web normale, cette approche multi-h&#244;te ou, plus pr&#233;cis&#233;ment, &#034;multi-origines&#034; est restreinte pour de bonnes raisons de s&#233;curit&#233;. Les d&#233;clarations de partage de ressources multi-origines ( Cross-Origin Resource Sharing, CORS ) permettent de contourner la contrainte.&lt;/p&gt;
&lt;p&gt;Les navigateurs se sont am&#233;lior&#233;s depuis la conception du flux implicite. La mise en &#339;uvre de CORS pour autoriser la demande de jeton &#224; partir de JavaScript est maintenant disponible, ainsi que les API de cryptographie n&#233;cessaires pour valider la signature du jeton JWT. &lt;br class='autobr' /&gt;
Il est donc techniquement possible d'utiliser le flux de code d'autorisation pour l'authentification et l'autorisation des applications sans back-end, y compris pour les applications &#224; page unique.&lt;/p&gt;
&lt;p&gt;Faut-il en d&#233;duire pour autant que l'utilisation de ce flux, dans cette configuration, garantit la s&#233;curit&#233; des donn&#233;es ?&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Avec les SPA, les probl&#232;mes de la s&#233;curit&#233; de l'authentification restent pos&#233;s&lt;/h3&gt;
&lt;p&gt;Les SPA sont des applications &#034;sans-back-end&#034;. Leur code se trouve sur l'agent utilisateur, donc n'importe o&#249;, contrairement aux applications &#034;avec back-end&#034; dont le code, unique, est prot&#233;g&#233; au sein d'un serveur. A ce titre :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Sont expos&#233;s dans le code, de fa&#231;on plus ou moins accessible au public :&lt;br class='autobr' /&gt; - l'identifiant et le secret de l'application, &lt;br class='autobr' /&gt; - les jetons d'acc&#232;s ou d'identit&#233;.&lt;/p&gt;
&lt;p&gt;Avec l'identifiant et le secret, une application malicieuse peut se procurer des jetons. Avec les jetons, elle pourrait demander des donn&#233;es au nom de la v&#233;ritable application.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; L'URL de redirection est celle de l'application, donc celle de son h&#244;te, c'est &#224; dire l'user-agent. Elle ne peut &#234;tre inscrite sur le serveur et doit &#234;tre fournie par l'application. &lt;br class='autobr' /&gt;
Si on est dans le cas d'user-agent de station de travail ( desktops ) situ&#233;s dans un espace de confiance ( un ou plusieurs domaines connus ), il reste encore possible de comparer cette URL &#224; un mod&#232;le enregistr&#233; sur le serveur d'autorisation. Mais m&#234;me dans ce cas, si l'application malveillante se trouve sur le m&#234;me h&#244;te&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb1' class='spip_note' rel='appendix' title='ce qui est non seulement le cas courant mais aussi le cas ( worst case ) (...)' id='nh1'&gt;1&lt;/a&gt;]&lt;/span&gt;, la distinction est impossible. Si on a affaire &#224; une application de mobile, cela devient vraiment risqu&#233;.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Dans le cas d'une application de mobile, la demande de jeton au point d'entr&#233;e Token et la r&#233;ponse ne circulent pas dans une liaison de serveur ( celui de l'application ) &#224; serveur ( le serveur d'authentification ) dans laquelle les deux extr&#233;mit&#233;s sont identifi&#233;es, mais entre diff&#233;rents mobiles non identifi&#233;s et le serveur d'authentification. &lt;strong&gt;Ainsi dispara&#238;t une des qualit&#233;s reconnues du flux de code d'autorisation appliqu&#233; aux clients avec back-end&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Il existe bien des &lt;a href='https://static.oa.dnc.global/-Authentifier-l-application-.html#typologiedesapplicationsauregarddelasecuritedesdonnees' class='spip_in'&gt;m&#233;thodes compl&#233;mentaires&lt;/a&gt; permettant de lier les jetons &#224; l'user-agent ou bien &#224; l'identifiant de connexion TLS (TLS Token Binding). Cela permet de prouver que l'user-agent ( ex. le navigateur de l'utilisateur final ) est bien celui avec lequel l'authentification a &#233;t&#233; effectu&#233;e et le jeton cr&#233;&#233;. Mais cela ne permet pas de discriminer la bonne application d'un malware ex&#233;cut&#233; sur la m&#234;me liaison TLS. Dans le m&#234;me ordre d'id&#233;es, la technique de preuve de possession &lt;a href='https://static.oa.dnc.global/-Authentifier-l-application-.html#proofofpossessionpop' class='spip_in'&gt;Proof of Possession (PoP)&lt;/a&gt; semble conduire &#224; la m&#234;me conclusion.&lt;/p&gt;
&lt;p&gt;En particulier, la m&#233;thode &#034;&lt;a href='https://static.oa.dnc.global/-Authentifier-l-application-.html#cledeverificationpourlechangedecodepkce' class='spip_in'&gt;Proof Key for Code Exchange, PKCE&lt;/a&gt;&#034; , appliqu&#233;e aux applications sans back-end dans le cadre du flux Authorization Code, renforce la s&#233;curit&#233; en &#233;vitant le d&#233;tournement du code d'autorisation. Avec cette technique, le secret de l'application n'est pas utilis&#233;, ce qui permet de ne pas le divulguer. Cependant, cela interdit d'identifier l'application. PKCE permet de s'assurer que l'application qui pr&#233;sente le code d'autorisation est bien celle dans laquelle a &#233;t&#233; effectu&#233;e la proc&#233;dure d'identification de l'utilisateur final, quelle que soit cette application.&lt;/p&gt;
&lt;p class=&#034;important&#034;&gt;Dans le cas d'une SPA comme dans celui de toute application sans back-end&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb2' class='spip_note' rel='appendix' title='Tout comme dans le cas d'une application native de mobile et de toute (...)' id='nh2'&gt;2&lt;/a&gt;]&lt;/span&gt;, il n'est pas possible de s'assurer que l'application qui pr&#233;sente le jeton est bien l'application attendue, et pas un malware. &lt;br class='autobr' /&gt;
De fait, il revient &#224; l'utilisateur d'identifier l'application ! Cela va bien dans le premier paradigme (prot&#233;ger les donn&#233;es de l'utilisateur), mais pas dans le deuxi&#232;me (prot&#233;ger les donn&#233;es de l'entit&#233;).&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Encapsuler les donn&#233;es crypt&#233;es dans une classe Javascript ???&lt;/h3&gt;
&lt;p&gt;Avec les SPA, il n'est pas possible de stocker des informations d'identification selon les m&#233;thodes classiques, telles que les jetons d'acc&#232;s dans les cookies et le stockage de session. Au lieu de cela, on imagine de conserver les donn&#233;es sensibles dans des variables JavaScript.&lt;/p&gt;
&lt;p&gt;Certains recommandent alors d'utiliser une classe Javascript pour stocker et fournir ces variables. Cette m&#233;thode re&#231;oit le joli nom d'&#034;encapsulation&#034; qui donne un aspect s&#233;rieux et innovant &#224; une m&#233;thode pourtant bien banale.&lt;/p&gt;
&lt;p&gt;Cependant, il ne s'agit l&#224; que d'une m&#233;thode d'obfuscation dont l'efficacit&#233; est insuffisante face &#224; un attaquant d&#233;termin&#233;. Un simple debugger web (tous les navigateurs modernes en int&#232;grent un) permet d'ex&#233;cuter pas &#224; pas le code et de voir passer les variables.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Pourquoi les sp&#233;cifications confirment-elles une pratique douteuse ?&lt;/h3&gt;
&lt;p&gt;On peut lire dans le document &lt;a href=&#034;https://openid.net/specs/openid-heart-oauth2-1_0.html#rfc.section.2.1.3&#034; class='spip_out' rel='external'&gt;Health Relationship Trust Profile for OAuth 2.0&lt;/a&gt;&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb3' class='spip_note' rel='appendix' title='Qui peut traduire &#034;Health Relationship Trust Profile&#034; ? Google Translator (...)' id='nh3'&gt;3&lt;/a&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;blockquote class=&#034;spip&#034;&gt;
&lt;p&gt;
2.1.3. Client int&#233;gr&#233; au navigateur avec d&#233;l&#233;gation d'utilisateur&lt;/p&gt;
&lt;p&gt;Ce type de client s'applique aux clients qui agissent pour le compte d'un propri&#233;taire de ressource particulier et n&#233;cessitent la d&#233;l&#233;gation des droits de cet utilisateur pour acc&#233;der &#224; la ressource prot&#233;g&#233;e. De plus, ces clients sont int&#233;gr&#233;s &#224; un navigateur Web et partagent efficacement une session active entre les syst&#232;mes.&lt;/p&gt;
&lt;p&gt;Ces clients utilisent le flux implicite de OAuth 2 en envoyant un propri&#233;taire de ressource au point terminal Authorize pour obtenir une autorisation. L'utilisateur DOIT s'authentifier aupr&#232;s du point terminal Authorize. Le navigateur Web de l'utilisateur est ensuite redirig&#233; vers un URI h&#233;berg&#233; par le client, &#224; partir duquel le client peut directement obtenir un jeton d'acc&#232;s. &#201;tant donn&#233; que &lt;strong&gt;le client lui-m&#234;me ne s'authentifie jamais aupr&#232;s du serveur et que le jeton est mis directement &#224; la disposition du navigateur&lt;/strong&gt;, ce flux ne convient que pour les clients incorpor&#233;s dans un navigateur Web, tel qu'un client JavaScript sans composant de serveur principal. Dans la mesure du possible, &lt;strong&gt;il est pr&#233;f&#233;rable d'utiliser le flux de code d'autorisation en raison de ses propri&#233;t&#233;s de s&#233;curit&#233; sup&#233;rieures&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Ce type de client NE DOIT PAS demander ou recevoir un jeton d'actualisation. Les jetons d'acc&#232;s &#233;mis &#224; ce type de client DOIVENT &#234;tre de courte dur&#233;e et DEVRAIENT &#234;tre rejet&#233;s &#224; l'expiration de la session authentifi&#233;e de l'utilisateur avec le client.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Il est donc bien reconnu qu'il y a un probl&#232;me que le flux de code d'autorisation ne r&#233;soudra pas. Ce flux est sans doute &#034;de s&#233;curit&#233; sup&#233;rieure&#034;, mais dans le cas des applications sans back-end il &#233;choue &#224; authentifier l'application, &#224; laquelle peut se substituer un malware situ&#233; sur l'agent utilisateur.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Pourtant, la r&#233;daction du paragraphe donne &#224; penser que le flux de code d'autorisation fera mieux que le flux implicite. Et on &#233;vite de fa&#231;on simple l'exposition du secret de l'application, et pour cause : &#034;le client lui-m&#234;me ne s'authentifie jamais aupr&#232;s du serveur&#034;.&lt;/p&gt;
&lt;p&gt;Dans ce contexte, &#233;voquer la s&#233;curit&#233; offerte par le flux &#034;Authorization Code&#034; est une &lt;i&gt;mascarade : n.f. com&#233;die hypocrite, mise en sc&#232;ne trompeuse&lt;/i&gt;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Un article pr&#233;sentant le contre et concluant sur le pour&lt;/h3&gt;
&lt;p&gt;Voici un article int&#233;ressant pour l'analyse qui est faite : &lt;a href=&#034;https://medium.com/@robert.broeckelmann/securely-using-the-oidc-authorization-code-flow-and-a-public-client-with-single-page-applications-55e0a648ab3a&#034; class='spip_out' rel='external'&gt;SECURELY USING THE OIDC AUTHORIZATION CODE FLOW AND A PUBLIC CLIENT WITH SINGLE PAGE APPLICATIONS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;L'auteur pr&#233;conise l'utilisation du flux d'autorisation avec code pour les SPA publiques, mais en fait une analyse d&#233;taill&#233;e qui met bien en &#233;vidence les multiples insuffisances de la configuration. Contrairement au titre &#034;Securely ...&#034; et &#224; la conclusion de l'article, voil&#224; encore une ambig&#252;it&#233;.&lt;/p&gt;
&lt;p&gt;En titrant sur les applications publiques, l'auteur &#233;vite au moins la divulgation du secret de l'application, puisqu'il n'y en a pas. Cela va faciliter le travail des applications malicieuses ! n'allons pas demander des donn&#233;es prot&#233;g&#233;es comme cela.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Incomp&#233;tence ou mensonge de marketing ?&lt;/h3&gt;
&lt;p&gt;Notre article a &#233;t&#233; motiv&#233; par la lecture de celui-ci : &lt;a href=&#034;https://www.ubisecure.com/single-sign-on/single-page-application-and-openid-connect/&#034; class='spip_url spip_out' rel='external'&gt;https://www.ubisecure.com/single-si...&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Le fil rouge de cet article est simple :&lt;/p&gt;
&lt;p&gt;1. Les progr&#232;s des navigateurs (CORS et cryptographie) permettent &#224; Javascript de mettre en &#339;uvre le flux authorization code.&lt;/p&gt;
&lt;p&gt;2. Donc, il ne faut plus mettre en &#339;uvre le flux implicite avec les SPA, mais le flux Authorization Code.&lt;br class='autobr' /&gt;
Sous entendu : puisque vous savez bien que le flux Authorization Code est celui qu'il faut employer avec OIDC, et qu'on vous avait bien dit que le flux implicite &#233;tait de s&#233;curit&#233; douteuse, vous comprenez que tout va bien maintenant.&lt;/p&gt;
&lt;p&gt;3. Bien s&#251;r, on doit stocker les jetons. Il faut les encapsuler dans une classe, comme cela ils seront bien cach&#233;s.&lt;/p&gt;
&lt;p&gt;Alors, incomp&#233;tence ou intox ? Ne s'agirait-il pas de faire croire &#224; un dispositif nouveau et cr&#233;diter ainsi l'existence d'un avantage comparatif sur la concurrence ?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pourquoi mentir ?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;OpenID Connect a une bonne image, cela se vend bien. Tant pis si les donn&#233;es ne sont s&#233;curis&#233;es que dans le cas des applications Web classiques. Vous voulez suivre la tendance des applications pour mobile ? Alors les marketeurs vous vendront OIDC sans vous avertir des limitations. &lt;br class='autobr' /&gt;
Mieux : ils mettront en avant les m&#233;thodes compl&#233;mentaires, telles que PKCE ou POP, en laissant croire qu'elles apportent la solution au probl&#232;me de l'authentification d'une l'application cliente sans back-end.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Qu'en est-il des serveurs headless ?&lt;/h3&gt;
&lt;p&gt;La configuration &#034;serveur headless&#034; est une architecture qui permet aux r&#233;dacteurs de produire et d'organiser du contenu, tout en fournissant aux d&#233;veloppeurs des donn&#233;es structur&#233;es qui peuvent &#234;tre affich&#233;es &#224; l'aide d'un syst&#232;me distinct sur le front-end d'un site Web ou d'une application.&lt;/p&gt;
&lt;p&gt;On aboutit souvent, c&#244;t&#233; front-end, &#224; une SPA.&lt;br class='autobr' /&gt;
Mais, puisque les donn&#233;es sont servies par une application avec back-end, il y a moyen de demander &#224; l'utilisateur final une authentification OIDC sur cette application, inscrite comme cliente du serveur OIDC. Si cela donne une garantie sur l'habilitation de l'utilisateur &#224; acc&#233;der aux donn&#233;es, cela ne permettra pas d'identifier la SPA et ce qu'elle fait des donn&#233;es.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Il n'y a donc aucun espoir de s&#233;curiser les SPA ?&lt;/h3&gt;
&lt;p&gt;Il y a une piste int&#233;ressante avec les applications install&#233;es sur mobile en mode Progressive Web App (PWA). Sous certaines conditions, le code et les donn&#233;es des PWA sont maintenus, c&#244;t&#233; mobile, identiques &#224; leur mod&#232;le c&#244;t&#233; serveur. Une telle architecture SPA - Serveur Headless (voyez &lt;a href=&#034;https://degoy.com/nos-techniques/spip-cms-headless-gatsby.html&#034; class='spip_out' rel='external'&gt;SPIP CMS headless + Gatsby&lt;/a&gt;) pourrait donc &#234;tre convenablement s&#233;curis&#233;e avec OIDC.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;i-Tego vous accompagne&lt;/h3&gt;
&lt;p&gt;i-Tego (h&#233;riti&#232;re de DnC) exerce un conseil et une assistance. Nous aidons nos clients &#224; mettre en &#339;uvre leur propre serveur OAuthSD. Nous accompagnons les Dev/Ops en leur transf&#233;rant notre comp&#233;tence, ce qui aboutit &#224; n'utiliser OIDC que dans des configurations s&#233;curis&#233;es. &lt;br class='autobr' /&gt;
Et nous reconnaissons &#224; sa juste valeur le travail des IT pour prot&#233;ger l'acc&#232;s au r&#233;seau, et cr&#233;er ainsi &#034;l'espace de confiance&#034; requis pour la bonne application d'OpenID Connect.&lt;/p&gt;&lt;/div&gt;
		&lt;hr /&gt;
		&lt;div class='rss_notes'&gt;&lt;div id='nb1'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh1' class='spip_note' title='Notes 1' rev='appendix'&gt;1&lt;/a&gt;] &lt;/span&gt;ce qui est non seulement le cas courant mais aussi le cas ( worst case ) que l'on doit prendre en compte pour une analyse de s&#233;curit&#233;&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb2'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh2' class='spip_note' title='Notes 2' rev='appendix'&gt;2&lt;/a&gt;] &lt;/span&gt;Tout comme dans le cas d'une application native de mobile et de toute application sans back-end. C'est le m&#234;me probl&#232;me, sauf peut-&#234;tre pour les applications de desktop dans un espace de confiance&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb3'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh3' class='spip_note' title='Notes 3' rev='appendix'&gt;3&lt;/a&gt;] &lt;/span&gt;Qui peut traduire &#034;Health Relationship Trust Profile&#034; ? Google Translator donne &#034;Profil de confiance des relations de sant&#233;&#034;. Ce titre incompr&#233;hensible aurait-il pour but de donner un aspect pseudo-scientifique &#224; un texte par ailleurs bien obscur ?&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>La fin des mots de passe : NoPassConnect</title>
		<link>https://static.oa.dnc.global/-Identifier-l-utilisateur-final-.html#lafindesmotsdepassenopassconnect</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-Identifier-l-utilisateur-final-.html#lafindesmotsdepassenopassconnect</guid>
		<dc:date>2021-05-25T14:43:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;i-Tego d&#233;veloppe NoPassConnect pour le serveur OAuthSD, une application de mobile permettant une identification tr&#232;s s&#233;curis&#233;e de l'utilisateur final sans mot de passe. Fond&#233;e sur les meilleures pratiques cryptographiques, cette m&#233;thode est ferm&#233;e &#224; une utilisation publique et se trouve donc particuli&#232;rement adapt&#233;e &#224; la s&#233;curisation des acc&#232;s aux donn&#233;es dans un domaine d'entreprise. &lt;br class='autobr' /&gt;
OAuthSD + NoPassConnect est une solution id&#233;ale pour s&#233;curiser les acc&#232;s aux applications des entreprises dans le cadre (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-Identifier-l-utilisateur-final-.html" rel="directory"&gt;Identifier l'utilisateur final&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L150xH111/arton194-ce8e6.jpg?1733820003' width='150' height='111' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;i-Tego&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb2-1' class='spip_note' rel='appendix' title='i-Tego est une nouvelle soci&#233;t&#233; cr&#233;&#233;e en juillet 2021 apr&#232;s la fermeture de DnC (...)' id='nh2-1'&gt;1&lt;/a&gt;]&lt;/span&gt; d&#233;veloppe NoPassConnect pour le serveur OAuthSD, une application de mobile permettant une identification tr&#232;s s&#233;curis&#233;e de l'utilisateur final sans mot de passe.&lt;/p&gt;
&lt;p&gt;Fond&#233;e sur les meilleures pratiques cryptographiques, cette m&#233;thode est ferm&#233;e &#224; une utilisation publique et se trouve donc particuli&#232;rement adapt&#233;e &#224; la &lt;a href=&#034;https://reseau-healthtech.fr/Un-rapport-deplore-le-niveau-de-la-securite-et-des-mots-de-passe-en-entreprise.html&#034; class='spip_out' rel='external'&gt;s&#233;curisation des acc&#232;s aux donn&#233;es dans un domaine d'entreprise&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;OAuthSD + NoPassConnect est une solution id&#233;ale pour s&#233;curiser les acc&#232;s aux applications des entreprises dans le cadre du t&#233;l&#233;travail.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;p&gt;La vid&#233;o suivante montre comment ouvrir une session OpenID Connect en un clic et sans mot de passe :&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;center&gt;&lt;div class=&#034;playerVideo&#034;&gt; &lt;section&gt; &lt;figure&gt; &lt;video width=&#034;640&#034; height=&#034;420&#034; preload=&#034;metadata&#034; tabindex=&#034;-1&#034; controls autobuffer autoplay poster=&#034;IMG/plugins-dist/medias/prive/vignettes/m4v.png&#034;&gt; &lt;source src=&#034;IMG/m4v/smartconnect1.m4v?ctime=1689608165&#034; type='video/mp4' /&gt; &lt;/video&gt; &lt;/figure&gt; &lt;/section&gt; &lt;/div&gt; &lt;!-- Fermeture de ID : playerVideo --&gt;&lt;/center&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Pour fonctionner, NoPassConnect n&#233;cessite :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; l'application mobile NoPassConnect install&#233;e sur un smartphone. Celui-ci doit &#234;tre connect&#233; &#224; Internet ou connect&#233; au r&#233;seau WiFi de l'entreprise ce qui &lt;strong&gt; permet une utilisation sanctuaris&#233;e dans un espace restreint&lt;/strong&gt;.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; un serveur OAuthSD avec le module d'identification NoPassConnect.&lt;br class='autobr' /&gt;
Les applications compatibles OpenID Connect n'ont pas besoin d'&#234;tre modifi&#233;es.&lt;/p&gt;
&lt;p&gt;OAuthSD peut int&#233;grer NoPassConnect comme m&#233;thode d'identification primaire, qui remplacera avantageusement des syst&#232;mes fond&#233;s sur des lecteurs de carte par exemple.&lt;br class='autobr' /&gt;
NoPassConnect peut &#233;galement &#234;tre utilis&#233; comme &lt;a href='https://static.oa.dnc.global/-Identifier-l-utilisateur-final-.html#validationen2etapestwofactorauthentication2fa' class='spip_in'&gt;identification secondaire (Identification &#224; deux facteurs, TFA)&lt;/a&gt;.&lt;br class='autobr' /&gt;
&lt;span class='spip_document_100 spip_documents spip_documents_center'&gt;
&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L398xH497/smartconnect_login-f0cb6.png?1733820003' width='398' height='497' alt=&#034;Login SmartConnect - NopassConnect&#034; title=&#034;Login SmartConnect - NopassConnect&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Les avantages de NoPassConnect :&lt;/h3&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;Productivit&#233;&lt;/strong&gt; : NoPassConnect permet une connexion ultra-rapide en mode SSO : il suffit de scanner un QR-Code pr&#233;sent&#233; &#224; l'&#233;cran par OAuthSD (une fois au d&#233;but d'une s&#233;ance de travail), le reste est automatique.&lt;br class='autobr' /&gt;
&lt;strong&gt;SmartConnect &#233;limine le besoin de mot de passe&lt;/strong&gt; et &#233;pargne le temps perdu &#224; r&#233;tablir les identifiants &#233;gar&#233;s.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;Economie&lt;/strong&gt; : NoPassConnect est install&#233; sur un mobile ordinaire&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb2-2' class='spip_note' rel='appendix' title='Actuellement sur syst&#232;me Android, IOS en cours de d&#233;veloppement.' id='nh2-2'&gt;2&lt;/a&gt;]&lt;/span&gt; sans n&#233;cessiter de mat&#233;riel suppl&#233;mentaire ni de protocoles d'installation complexes. Une entreprise peut envisager d'&#233;quiper un tr&#232;s grand nombre d'utilisateurs, y compris ext&#233;rieurs, pour une fraction du prix d'un syst&#232;me d'identification mat&#233;riel, avec un gain de temps pour l'administration et la maintenance. C'est &lt;strong&gt;l'id&#233;al pour le t&#233;l&#233;travail&lt;/strong&gt; !&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;Faible surface d'attaque&lt;/strong&gt; : les mots de passe sont le maillon faible de l'identification. NoPassConnect les remplace par des informations cryptographiques robustes, &#224; usage unique.&lt;br class='autobr' /&gt;
Les &#233;changes sont limit&#233;s &#224; une liaison crypt&#233;e mobile-serveur OAuthSD. &lt;br class='autobr' /&gt;
Il n'y a pas de logiciel &#224; installer sur les stations de travail ou sur les navigateurs (contrairement &#224; un lecteur d'ID card) ; ceux-ci n'interviennent pas dans le protocole d'identification de NoPassConnect, ni a fortiori leurs liaisons publiques, ce qui permet d'&#233;viter deux cibles d'attaques particuli&#232;rement vuln&#233;rables.&lt;/p&gt;
&lt;p&gt;De plus :&lt;br class='autobr' /&gt;
NoPassConnect est fond&#233; sur une communication par le r&#233;seau de donn&#233;es mobiles (et non l'Internet) entre un mobile connect&#233; et le serveur d'authentification (OP) auquel les applications ont d&#233;l&#233;gu&#233; l'identification des utilisateurs.&lt;/p&gt;
&lt;p&gt;NoPassConnect ne r&#233;pond jamais &#224; une demande et ne n&#233;cessite pas d'entr&#233;e au clavier (pas d'identifiant, de mot de passe ou de code) ce qui ferme la plupart des possibilit&#233; d'attaques et distingue la solution de ses concurrentes.&lt;/p&gt;
&lt;p&gt;Ces deux caract&#233;ristiques sont innovantes et constituent un apport original.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;S&#233;curit&#233;&lt;/strong&gt; : Mieux qu'un mot de passe qui peut &#234;tre compromis, un smartphone est un objet tr&#232;s personnel, mieux gard&#233; par son propri&#233;taire que tout autre objet. Sa perte ou son vol sont rapidement constat&#233;s (alors qu'il n'y a g&#233;n&#233;ralement pas moyen de savoir si un mot de passe a &#233;t&#233; compromis), ce qui permet &#224; un administrateur d'invalider rapidement son enregistrement sur le serveur OAuthSD.&lt;/p&gt;
&lt;p&gt;De plus, les smartphones sont &#233;quip&#233;s de syst&#232;mes de reconnaissance biom&#233;trique de plus en plus performants. L'identification au moyen du smartphone permet donc de pr&#233;juger valablement de l'identit&#233; de l'utilisateur final.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;Segmentation g&#233;ographique&lt;/strong&gt; : Par d&#233;faut, l'usage de NoPassConnect peut se faire &#224; partir de n'importe quelle connexion de donn&#233;es, qu'il s'agisse du r&#233;seau d'un op&#233;rateur ou d'un r&#233;seau WiFi. L'usage de NoPassConnect peut-&#234;tre limit&#233; au r&#233;seau WiFi de l'entreprise, jusqu'&#224; s&#233;lectionner par leur IP locale les bornes autoris&#233;es. Il serait &#233;galement possible d'autoriser une connexion domestique donn&#233;e pour permettre le travail &#224; domicile. Il est &#233;galement possible, sur un r&#233;seau d'entreprise, de d&#233;finir les postes de travail capables ou non de se connecter avec NoPassConnect .&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;Authentification&lt;/strong&gt; : NoPassConnect impose l'identifiant OpenID de l'utilisateur, qui est int&#233;gr&#233; au moment de la &lt;strong&gt;configuration initiale du mobile sous le contr&#244;le d'un administrateur&lt;/strong&gt;. Au cours de cette op&#233;ration, le mobile doit scanner un QR-Code pr&#233;sent&#233; par l'administrateur, ce qui permet d'identifier l'utilisateur avec rigueur ( &#224; l'oppos&#233; de l'enregistrement &#224; distance tel que pratiqu&#233; par WebAuthn par exemple ).&lt;/p&gt;
&lt;p&gt;Les administrateurs peuvent affecter en temps r&#233;el les autorisations ou d&#233;nier les acc&#232;s. Plusieurs dispositifs permettent de d&#233;tecter et de bloquer automatiquement des usages d&#233;tourn&#233;s, comme par exemple l'utilisation d'une autre station de travail que celles qui auront &#233;t&#233; autoris&#233;es, etc.&lt;/p&gt;
&lt;blockquote class=&#034;spip&#034;&gt;
&lt;p&gt; En r&#233;sum&#233;, les avantages d&#233;terminants pour la s&#233;curit&#233; des donn&#233;es d'une entreprise sont : l'utilisation de moyens priv&#233;s, l'identification de l'utilisateur assur&#233;e par un administrateur, la possibilit&#233; de limiter l'usage &#224; des lieux d&#233;termin&#233;s.&lt;/p&gt;
&lt;/blockquote&gt;&lt;h3 class=&#034;spip&#034;&gt;Entendu ...&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Bah, trop simple le QR-Code qui sert de mot de passe !&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Pas du tout : le QR-Code n'est qu'un identifiant de session pour les &#233;changes qui vont suivre entre le serveur et le smartphone. Il est &#233;ph&#233;m&#232;re et ne peut donc &#234;tre r&#233;utilis&#233;. L'authentification r&#233;sulte d'un &#233;change de donn&#233;es faisant appel &#224; des techniques cryptographiques fortes. Le navigateur n'intervient pas dans les &#233;changes qui se font directement entre le smartphone et le serveur OAuthSD.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ah oui, c'est un Time-based One-time Password (TOTP) comme Google Authenticator !&lt;/strong&gt;&lt;br class='autobr' /&gt;
Eh bien non :&lt;/p&gt;
&lt;p&gt;NoPassConnect est un dispositif priv&#233;, ne faisant pas appel &#224; des syst&#232;mes tiers, pour une meilleure s&#233;curit&#233; et une parfaite confidentialit&#233;.&lt;/p&gt;
&lt;p&gt;NoPassConnect impose l'identit&#233; de l'utilisateur de l'entreprise, configur&#233;e par un administrateur. Un TOTP ne fait que v&#233;rifier que l'utilisateur est bien celui qui s'est inscrit lui-m&#234;me sur le syst&#232;me. En somme, un TOTP prot&#232;ge l'utilisateur tandis que NoPassConnect prot&#232;ge l'entreprise propri&#233;taire du serveur OAuthSD.&lt;/p&gt;
&lt;p&gt;OAuthSD propose le TOTP Google Authenticator pour l'authentification &#224; deux facteurs : jugez de la diff&#233;rence par vous m&#234;me.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ah oui, c'est comme la confirmation par SMS !&lt;/strong&gt;&lt;br class='autobr' /&gt;
Eh bien non :&lt;/p&gt;
&lt;p&gt;Le 2FA par SMS n'est pas s&#233;curis&#233;, alors que NoPassConnect &#233;change des donn&#233;es crypt&#233;es sur un canal s&#233;curis&#233; avec SSL/TLS.&lt;/p&gt;
&lt;p&gt;De plus le code re&#231;u par SMS doit &#234;tre retourn&#233; par le m&#234;me canal (le navigateur), ce qui ouvre la porte &#224; de nombreuses techniques d'interception telles que le l'ing&#233;nierie sociale, l'interception de trafic, le key-login ; avec NoPassConnect le navigateur n'intervient pas dans ces &#233;changes, l'identification se fait entre le smartphone et le serveur OAuthSD.&lt;/p&gt;
&lt;p&gt;Et si c'est l'utilisateur final lui-m&#234;me qui a fourni son num&#233;ro de portable au moment de son inscription, on n'a absolument aucune information sur son identit&#233; r&#233;elle ! NoPassConnect impose la configuration du smartphone sous le contr&#244;le d'un administrateur.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;J'ai trouv&#233; : c'est comme WebAuthn !&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;C'est assez proche en apparence, mais tr&#232;s diff&#233;rent : NoPassConnect concoure &#224; l'ouverture et &#224; la fermeture d'une session OpenID Connect &#224; partir d'une application qui lui est ext&#233;rieure, tandis que WebAuthn se limite &#224; l'identification directe de son porteur.&lt;/p&gt;
&lt;p&gt;C'est &#233;galement tr&#232;s diff&#233;rent en termes de s&#233;curit&#233; :&lt;/p&gt;
&lt;p&gt;WebAuthn pr&#233;sente un d&#233;savantage important pour la s&#233;curit&#233; d'une entreprise : comme la plupart des syst&#232;me de login, WebAuthn est un syst&#232;me public dans le sens o&#249; c'est l'utilisateur qui enregistre de fa&#231;on anonyme son mobile, rien ne permet de l'identifier. Permettre &#224; un utilisateur de s'enregistrer sans qu'il y ait une &#233;tape d'identification physique, c'est exactement comme lui permettre de fabriquer lui-m&#234;me sa carte d'identit&#233;, et encore : en rempla&#231;ant son nom par un pseudo.&lt;/p&gt;
&lt;p&gt;A l'inverse, l'enregistrement d'un mobile NoPassConnect est fait &#224; l'initiative et sous le contr&#244;le d'un administrateur de l'entreprise, en pr&#233;sentiel, ce qui permet d'enregistrer dans le serveur OpenID Connect l'identit&#233; r&#233;elle de l'utilisateur.&lt;/p&gt;
&lt;p&gt;Enfin, r&#233;p&#233;tons-le : avec NoPassConnect, le navigateur n'intervient pas dans le processus d'identification qui se fait directement entre le smartphone et le serveur OAuthSD.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ah oui, c'est un peu comme un lecteur d'ID card ...&lt;/strong&gt; &lt;br class='autobr' /&gt;
Presque ! En mieux :&lt;/p&gt;
&lt;p&gt;C'est plus &#233;conomique, plus facile &#224; d&#233;ployer, moins vuln&#233;rable.&lt;/p&gt;
&lt;p&gt;De plus, NoPassConnect n'&#233;tant pas li&#233; physiquement &#224; un poste de travail, il peut &#234;tre d&#233;ploy&#233; hors du p&#233;rim&#232;tre de l'entreprise. Cela n'interdit pas de limiter l'utilisation de NoPassConnect &#224; un ou plusieurs postes de travail, c'est l'un des avantages de scanner le QR-Code affich&#233; par le poste de travail !&lt;/p&gt;
&lt;p&gt;Enfin, si un utilisateur peut oublier sa carte dans le lecteur en quittant le bureau, il est probable qu'il n'oubliera pas de prendre son smartphone avec lui...&lt;/p&gt;&lt;/div&gt;
		&lt;hr /&gt;
		&lt;div class='rss_notes'&gt;&lt;div id='nb2-1'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh2-1' class='spip_note' title='Notes 2-1' rev='appendix'&gt;1&lt;/a&gt;] &lt;/span&gt;&lt;a href=&#034;https://i-tego.com&#034; class='spip_out' rel='external'&gt;i-Tego&lt;/a&gt; est une nouvelle soci&#233;t&#233; cr&#233;&#233;e en juillet 2021 apr&#232;s la fermeture de DnC en d&#233;cembre 2020. B.D. a commenc&#233; le d&#233;veloppement de SmartConnect dans l'intervalle en utilisant provisoirement ce site web en attendant qu'i-Tego poss&#232;de son propre site documentaire&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb2-2'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh2-2' class='spip_note' title='Notes 2-2' rev='appendix'&gt;2&lt;/a&gt;] &lt;/span&gt;Actuellement sur syst&#232;me Android, IOS en cours de d&#233;veloppement.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
		&lt;div class='rss_ps'&gt;&lt;h3 class=&#034;spip&#034;&gt;[DR] Composants logiciels de OAuthSD / SmartConnect&lt;/h3&gt;
&lt;p&gt;&lt;span class='spip_document_102 spip_documents spip_documents_center'&gt;
&lt;img src='https://static.oa.dnc.global/IMG/png/smartconnect_composants_crobard.png' width=&#034;928&#034; height=&#034;619&#034; alt=&#034;Composants de SmartConnect&#034; title=&#034;Composants de SmartConnect&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;SmartConnect est une &lt;strong&gt;application de mobile (4) &lt;/strong&gt; ( Android ou iOS) qui n&#233;cessite un &lt;strong&gt;serveur OAuthSD (1)&lt;/strong&gt;. Pour son fonctionnement, l'application SmartConnect est en relation avec un &lt;strong&gt;module d'authentification (2)&lt;/strong&gt; (Pluggable Authentication Module, PAM) int&#233;gr&#233; &#224; OAuthSD, mais n'est pas connect&#233; aux &lt;strong&gt;applications compatibles OpenID Connect (3)&lt;/strong&gt;. &lt;br class='autobr' /&gt;
SmartConnect se situe au sein des distributions OAuthSD comme repr&#233;sent&#233; dans le le tableau suivant :&lt;/p&gt;
&lt;p&gt;Dans ce tableau, les composants sur fond bleu-clair sont d&#233;velopp&#233;s par DnC :&lt;br class='autobr' /&gt;
&lt;span class='spip_document_101 spip_documents spip_documents_center'&gt;
&lt;img src='https://static.oa.dnc.global/IMG/png/smartconnect_composants.png' width=&#034;1075&#034; height=&#034;476&#034; alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;OAuthSD comprend trois groupes de composants :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; le &lt;strong&gt;Superviseur&lt;/strong&gt;, est une application Web permettant aux administrateurs d'enregistrer les applications clientes d'OAuthSD, de contr&#244;ler l'inscription des utilisateurs et de leurs droits sur les applications et enfin de suivre le fonctionnement des authentifications. &lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; Le Daemon (le serveur OIDC &#224; proprement parler) qui est construit sur des modules interm&#233;diaires (&lt;strong&gt;middleware&lt;/strong&gt;) d&#233;velopp&#233;s par DnC fournissant la version haut-niveau des contr&#244;leurs Authorize, Token etc., et finalement sur des biblioth&#232;ques open-source pour le code de bas-niveau.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; Des &lt;strong&gt;modules d'authentification&lt;/strong&gt; (Pluggable Authentification Modules (PAM)) int&#233;gr&#233;s &#224; OAuthSD assurant l'identification primaire et secondaire pour l'identification &#224; deux facteurs.&lt;/p&gt;
&lt;p&gt;Le &lt;strong&gt;module NoPassConnect&lt;/strong&gt; (ex IdentMaster, SmartConnect) assure la communication entre le mobile &#233;quip&#233; de l'application NoPassConnectet le serveur. Il comporte &#233;galement une application qui permet aux administrateurs de configurer l'instance NoPassConnectd'un mobile donn&#233; et de l'enregistrer sur le serveur.&lt;/p&gt;
&lt;p&gt;Pour pouvoir d&#233;l&#233;guer l'authentification au serveur OAuthSD, les applications doivent &#234;tre dot&#233;s d'un &lt;strong&gt;module OpenID Connect&lt;/strong&gt;. De plus en plus d'applications professionnelles int&#232;grent un tel module. Les applications qui ne sont pas directement compatibles offrent souvent un syst&#232;me de modules qui permet d'ajouter la fonctionnalit&#233; OIDC. Il en est ainsi de WordPress et de phpBB.&lt;/p&gt;
&lt;p&gt;Les applications d'Identit&#233; sont des logiciels d&#233;di&#233;s install&#233;s sur le mobile au-dessus du syst&#232;me d'exploitation Android, iOS, BlackBerry, etc. Ce sont donc des applications natives, &#224; l'inverse par exemple de l'authentification par SMS qui s'appuie sur une application existante ou d'autres proc&#233;d&#233;s s'appuyant sur le navigateur. L'&lt;strong&gt;application NoPassConnect&lt;/strong&gt; est une application native, d&#233;velopp&#233;e en Java, qui peut &#234;tre install&#233;e par l'utilisateur.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;[CONF] Particularit&#233;s du proc&#233;d&#233; en faveur de la s&#233;curit&#233;&lt;/h3&gt;
&lt;p&gt;[CONF] Compar&#233; au principe du TOTP ou de la v&#233;rification par SMS (un code d&#233;pendant de l'utilisateur et limit&#233; dans le temps), SmartConnect est beaucoup plus s&#233;curis&#233; : le QR-Code est &#224; usage unique, et la r&#233;ponse de l'application SmartConnect int&#232;gre l'identifiant OpenID de l'utilisateur et l'ID du mobile, mix&#233; avec un alea qui rend la r&#233;ponse unique, le tout transmis au moyen d'un jeton crypt&#233;.&lt;/p&gt;
&lt;p&gt;[CONF] Notons &#233;galement que, contrairement &#224; un syst&#232;me de confirmation TFA, l'utilisateur n'est pas interrog&#233; &#224; l'initiative d'un syst&#232;me dont il ignore le lien r&#233;el avec l'application l&#233;gitime (celle qu'il veut lancer), mais c'est lui qui prend l'initiative de poursuivre (en scannant le QR-Code) le dialogue d'authentification qu'il a initialis&#233; depuis l'application. L'utilisateur est actif au lieu d'&#234;tre passif. Le mobile ne traite pas de connexion entrante, mais utilise le canal de retour de la connexion qu'il a lui-m&#234;me &#233;tablie, le mettant ainsi &#224; l'abri d'attaques web.&lt;/p&gt;
&lt;p&gt;[CONF] Enfin, le terminal sur lequel s'affiche le QR-Code se trouve li&#233; dans le processus d'authentification, ce qui permet au serveur OAuthSD de s'assurer que l'utilisateur est bien devant le terminal. Ainsi, les authentifications ne peuvent &#234;tre initi&#233;es que depuis des terminaux r&#233;pertori&#233;s.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Exp&#233;rimental : t&#233;l&#233;chargez et installez l'application sur votre mobile Android&lt;/h3&gt;
&lt;p&gt;Sur votre mobile Android :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; T&#233;l&#233;chargez l'APK : &lt;br class='autobr' /&gt;
&lt;a href=&#034;https://i-tego.com/store/app-release.apk&#034; class='spip_out' rel='external'&gt;i-tego.com/store/app-release.apk&lt;/a&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; Activez les sources inconnues :&lt;br class='autobr' /&gt;
Allez dans les param&#232;tres, puis S&#233;curit&#233;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; Recherchez l'APK sur votre t&#233;l&#233;phone (&#224; l'aide d'un explorateur de fichiers par exemple)
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; Lancez le fichier APK et suivez les instructions
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/squelettes-dist/puce.gif' width=&#034;8&#034; height=&#034;11&#034; class=&#034;puce&#034; alt=&#034;-&#034; /&gt; D&#233;sactivez les sources inconnues&lt;/p&gt;&lt;/div&gt;
		</content:encoded>


		
		<enclosure url="https://static.oa.dnc.global/IMG/m4v/smartconnect1.m4v" length="2578001" type="video/x-m4v" />
		

	</item>
<item xml:lang="fr">
		<title>OAuthSD vers la Certification OpenID (r)</title>
		<link>https://static.oa.dnc.global/-Tests-et-certification-.html#oauthsdverslacertificationopenidr</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-Tests-et-certification-.html#oauthsdverslacertificationopenidr</guid>
		<dc:date>2021-04-28T18:10:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;OAuthSD a satisfait aux tests en vue de la certification OpenID. &lt;br class='autobr' /&gt;
L'auteur (B.D.) est membre de l'OpenID Foundation, ce qui lui permet d'introduire OAuthSD dans le processus de certification en vue d'obtenir le label &#034;OpenID Certified&#034;. &lt;br class='autobr' /&gt;
Avril 2021 - Nouvelle s&#233;rie de tests &lt;br class='autobr' /&gt;
Les tests OIDF Conformance ont &#233;volu&#233;, OAuthSD aussi, de nouveaux tests ont &#233;t&#233; effectu&#233;s pour les flux OpenID Authorization Code et Implicit. &lt;br class='autobr' /&gt;
Tests de certification du flux Authorization Code (response_type 'code') Le r&#233;sultat (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-Tests-et-certification-.html" rel="directory"&gt;Tests et certification&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L150xH109/arton118-f07d9.png?1733820003' width='150' height='109' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;OAuthSD a satisfait aux tests en vue de la &lt;a href=&#034;https://openid.net/certification/&#034; class='spip_out' rel='external'&gt;certification OpenID&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;p&gt;L'auteur (B.D.) est membre de l'OpenID Foundation, ce qui lui permet d'introduire OAuthSD dans le processus de certification en vue d'obtenir le label &#034;OpenID Certified&#034;.&lt;/p&gt;
&lt;p&gt;&lt;a id=&#034;testsavril2021&#034;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Avril 2021 - Nouvelle s&#233;rie de tests&lt;/h3&gt;
&lt;p&gt;Les tests OIDF Conformance ont &#233;volu&#233;, &lt;a href=&#034;https://oa.dnc.global/web/-Decouvrir-.html#oauthsdv2&#034; class='spip_out' rel='external'&gt;OAuthSD aussi&lt;/a&gt;, de nouveaux tests ont &#233;t&#233; effectu&#233;s pour les flux OpenID Authorization Code et Implicit.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tests de certification du flux Authorization Code (response_type 'code') &lt;/strong&gt;&lt;br class='autobr' /&gt;
Le r&#233;sultat est visible &#224; l'URL :&lt;br class='autobr' /&gt;
&lt;a href=&#034;https://www.certification.openid.net/plan-detail.html?plan=5pu5MgJdbusGd&amp;public=true&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;https://www.certification.openid.net/plan-detail.html?plan=5pu5MgJdbusGd&amp;public=true&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class='spip_document_106 spip_documents spip_documents_center'&gt;
&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L500xH643/oidcc-basic-certification-test-plan_20210428-e07df.png?1733820004' width='500' height='643' alt=&#034;OAuthSD oidcc-basic certification test&#034; title=&#034;OAuthSD oidcc-basic certification test&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Commentaires :&lt;/strong&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; test &#034;oidcc-unsigned-request-object-supported-correctly-or-rejected-as-unsupported&#034; : EXPERIMENTAL : OAuthSD impl&#233;mente le param&#232;tre 'request' sous sa forme JWT non sign&#233; et pass&#233; par valeur (comme l'attend ce test). &lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; test 'oidcc-claims-essential' : Notre avis et qu'il s'agit l&#224; d'un &#233;cart inutile par rapport &#224; la rigueur de la sp&#233;cification g&#233;n&#233;rale, pr&#233;judiciable &#224; la s&#233;curit&#233; des donn&#233;es personnelles. OAuthSD n'impl&#233;mente pas le param&#232;tre 'claims' ainsi que l'indique son document de d&#233;couverte, le test devrait donc &#234;tre saut&#233;. Cependant, le test se traduit par un avertissement, ce qui n'est pas un obstacle &#224; la certification.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; test &#034;oidcc-refresh-token&#034; : ce test est saut&#233; car le client de test a &#233;t&#233; configur&#233; sans le flux &#034;refresh_token&#034;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Test de certification du flux Implicit (response_type 'token' et 'id_token token')&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Le r&#233;sultat est visible &#224; l'URL :&lt;br class='autobr' /&gt;
&lt;a href=&#034;https://www.certification.openid.net/plan-detail.html?plan=7Z0tOWnMttGlm&amp;public=true&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;https://www.certification.openid.net/plan-detail.html?plan=7Z0tOWnMttGlm&amp;public=true&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class='spip_document_107 spip_documents spip_documents_center'&gt;
&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L500xH574/oidcc-implicit-certification-test-plan_20210501-70a23.png?1733820004' width='500' height='574' alt=&#034;OAuthSD oidc implicit certification test&#034; title=&#034;OAuthSD oidc implicit certification test&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Cette s&#233;rie appelle les m&#234;mes commentaires que la pr&#233;c&#233;dente.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Mai 2019 - Configuration Basic OP : succ&#232;s &#224; 100% !&lt;/h3&gt;
&lt;p&gt;Cette configuration teste OAuthSD en tant que OP (OpenID Connect Provider) avec le flux Authorization Code.&lt;br class='autobr' /&gt;
Le r&#233;sultat des tests peut &#234;tre vu ci-dessous. On voit que OAuthSD remplit 100% des exigences (Il est normal que le test OP-redirect_uri-NotReg reste &#224; l'&#233;tat non compl&#233;t&#233;)&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb3-1' class='spip_note' rel='appendix' title='Il est normal que le test OP-redirect_uri-NotReg reste &#224; l'&#233;tat non compl&#233;t&#233; (...)' id='nh3-1'&gt;1&lt;/a&gt;]&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class='spip_document_74 spip_documents spip_documents_center'&gt;
&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L500xH1272/tests_basic_op-c343a.png?1733820004' width='500' height='1272' alt=&#034;&#034; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;La certification OpenID peut &#234;tre obtenue avec quelques tests &#224; l'&#233;tat &#034;Warning&#034;. Notre engagement de qualit&#233; nous commande de satisfaire &#224; 100% des tests.&lt;/i&gt;&lt;/p&gt;&lt;/div&gt;
		&lt;hr /&gt;
		&lt;div class='rss_notes'&gt;&lt;div id='nb3-1'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh3-1' class='spip_note' title='Notes 3-1' rev='appendix'&gt;1&lt;/a&gt;] &lt;/span&gt;Il est normal que le test OP-redirect_uri-NotReg reste &#224; l'&#233;tat non compl&#233;t&#233; car &#034;Ce test devrait avoir pour r&#233;sultat que le fournisseur OpenID affiche un message d'erreur dans votre agent d'utilisateur. Vous devez ignorer le statut de ce test dans l'outil de test, car il sera incomplet.&#034;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>API Open ID Connect : Introspection (Introspection Endpoint)</title>
		<link>https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectintrospectionintrospectionendpoint</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectintrospectionintrospectionendpoint</guid>
		<dc:date>2021-04-15T08:15:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;L'introspection permet &#224; une application cliente ou &#224; un serveur de ressource (RS) de valider un jeton aupr&#232;s du serveur d'authentification (AS) . &lt;br class='autobr' /&gt;
Les jetons soumis peuvent &#234;tre du type Access Token, Identity Token (JWT) ou Json Web Encryption (JWE). Impl&#233;mentation de l'Introspection &lt;br class='autobr' /&gt;
Il n'y a pas (&#224; ce jour) de &#034;norme&#034; d&#233;finissant l'Introspection pour OpenID Connect. Cependant, OAuthSD, ainsi que les impl&#233;mentations courantes, se fonde sur la proposition de standard RFC 7662 : OAuth 2.0 Token (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html" rel="directory"&gt;API OpenID Connect : Points d'extr&#233;mit&#233;&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L128xH128/arton54-a2dc1.png?1733821221' width='128' height='128' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;L'introspection permet &#224; une application cliente ou &#224; un serveur de ressource (RS) de valider un jeton aupr&#232;s du serveur d'authentification (AS) .&lt;/p&gt;
&lt;p&gt;Les jetons soumis peuvent &#234;tre du type &lt;a href='https://static.oa.dnc.global/-Gestion-du-jeton-d-acces-.html' class='spip_in'&gt;Access Token&lt;/a&gt;, &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jsonwebtokenjwt' class='spip_in'&gt;Identity Token (JWT)&lt;/a&gt; ou &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jwejsonwebencryption' class='spip_in'&gt;Json Web Encryption (JWE)&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;h3 class=&#034;spip&#034;&gt;Impl&#233;mentation de l'Introspection&lt;/h3&gt;
&lt;p&gt;Il n'y a pas (&#224; ce jour) de &#034;norme&#034; d&#233;finissant l'Introspection pour OpenID Connect. Cependant, OAuthSD, ainsi que les impl&#233;mentations courantes, se fonde sur la proposition de standard &lt;a href=&#034;https://tools.ietf.org/html/rfc7662&#034; class='spip_out' rel='external'&gt;RFC 7662 : OAuth 2.0 Token Introspection&lt;/a&gt;. DnC a propos&#233; une fonction d'&lt;a href=&#034;https://github.com/bshaffer/oauth2-server-php/pull/964&#034; class='spip_out' rel='external'&gt;introspection pour la biblioth&#232;que OAuth 2.0 PHP&lt;/a&gt;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Proposition de standard RFC 7662&lt;/h3&gt;
&lt;p&gt;&lt;i&gt;Traduction d'un extrait du document &lt;a href=&#034;https://tools.ietf.org/html/rfc7662&#034; class='spip_out' rel='external'&gt;RFC 7662 : OAuth 2.0 Token Introspection&lt;/a&gt;&lt;/i&gt;&lt;/p&gt;
&lt;blockquote class=&#034;spip&#034;&gt;
&lt;p&gt;
2.2. R&#233;ponse d'introspection&lt;/p&gt;
&lt;p&gt; Le serveur r&#233;pond avec un objet JSON [RFC7159] dans le format &#034;application/json &#034;avec les membres de niveau sup&#233;rieur suivants.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;active&lt;/strong&gt;&lt;br class='autobr' /&gt;
CHAMPS OBLIGATOIRE. bool&#233;en indiquant si le jeton pr&#233;sent&#233; est actuellement actif ou non. Les sp&#233;cificit&#233;s de l'&#233;tat &#034;actif&#034; d'un jeton variera en fonction de la mise en &#339;uvre du serveur d'autorisation et les informations qu'il conserve sur ses jetons, mais une &#034;vraie&#034;&lt;br class='autobr' /&gt;
valeur retourn&#233;e pour la propri&#233;t&#233; &#034;active&#034; indiquera g&#233;n&#233;ralement qu'un jeton donn&#233; a &#233;t&#233; &#233;mis par ce serveur d'autorisation, n'a pas &#233;t&#233; r&#233;voqu&#233; par le propri&#233;taire de la ressource et rel&#232;ve de sa fen&#234;tre de validit&#233; donn&#233;e (par exemple, apr&#232;s son heure d'&#233;mission et avant son heure d'expiration). Voir la section 4 pour des informations sur la mise en &#339;uvre de ces contr&#244;les.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;scope&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Une cha&#238;ne JSON contenant une liste de port&#233;es associ&#233;es &#224; ce jeton, dans le format d&#233;crit dans la Section 3.3 de OAuth 2.0 [RFC6749].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;client_id&lt;/strong&gt;&lt;br class='autobr' /&gt; OPTIONNEL. Identifiant de client pour le client OAuth 2.0 qui a demand&#233; ce jeton.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;username&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Identifiant lisible par l'homme pour le propri&#233;taire de la ressource qui a autoris&#233; ce jeton.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;token_type&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Type de jeton tel que d&#233;fini dans la section 5.1 de OAuth 2.0 [RFC6749].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;exp&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Horodatage entier, mesur&#233; en nombre de secondes depuis le 1er janvier 1970 UTC, en indiquant la date d'expiration de ce jeton, comme d&#233;fini dans JWT [RFC7519].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;iat&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Horodatage entier, mesur&#233; en nombre de secondes depuis le 1er janvier 1970 UTC, en indiquant quand ce jeton a &#233;t&#233; publi&#233; &#224; l'origine, tel que d&#233;fini dans JWT [RFC7519].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nbf&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Horodatage entier, mesur&#233; en nombre de secondes depuis le 1er janvier 1970 UTC, en indiquant quand ce jeton ne doit pas &#234;tre utilis&#233; auparavant, comme d&#233;fini dans JWT [RFC7519].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;sub&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Sujet du jeton, tel que d&#233;fini dans JWT [RFC7519].&lt;br class='autobr' /&gt;
G&#233;n&#233;ralement, un identifiant lisible par machine du propri&#233;taire de la ressource qui a autoris&#233; ce jeton.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;aud&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. cha&#238;ne Identifiant sp&#233;cifique au service ou liste de cha&#238;nes identifiants repr&#233;sentant le public vis&#233; pour ce jeton, comme d&#233;fini dans JWT [RFC7519].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;iss&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Cha&#238;ne repr&#233;sentant l'&#233;metteur de ce jeton, sous la forme d&#233;finie dans JWT [RFC7519].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;jti&lt;/strong&gt;&lt;br class='autobr' /&gt;
OPTIONNEL. Identificateur de cha&#238;ne pour le jeton, tel que d&#233;fini dans JWT [RFC7519].&lt;/p&gt;
&lt;p&gt;Des impl&#233;mentations sp&#233;cifiques PEUVENT &#233;tendre cette structure avec leurs propres noms de r&#233;ponse sp&#233;cifiques aux services en tant que membres de niveau sup&#233;rieur de cet objet JSON. Les noms de r&#233;ponse destin&#233;s &#224; &#234;tre utilis&#233;s sur plusieurs domaines DOIVENT &#234;tre inscrit dans le registre &#034;OAuth Token Introspection Response&#034; d&#233;fini &#224; la section 3.1.&lt;/p&gt;
&lt;p&gt;Le serveur d'autorisation PEUT r&#233;pondre diff&#233;remment &#224; diff&#233;rentes ressources prot&#233;g&#233;es faisant la m&#234;me demande. Par exemple, un serveur d'autorisation PEUT limiter les port&#233;es d'un jeton donn&#233; retourn&#233; pour chaque ressource prot&#233;g&#233;e pour emp&#234;cher une ressource prot&#233;g&#233;e d'en apprendre davantage sur le r&#233;seau que n&#233;cessaire pour son fonctionnement.&lt;/p&gt;
&lt;p&gt;La r&#233;ponse PEUT &#234;tre mise en cache par la ressource prot&#233;g&#233;e pour am&#233;liorer les performances et r&#233;duire la charge sur le point final d'introspection, mais au prix de la qualit&#233; de la validit&#233; des informations utilis&#233;es par la ressource prot&#233;g&#233;e pour prendre des d&#233;cisions d'autorisation. Voir la section 4 pour plus d'informations en ce qui concerne le compromis lorsque la r&#233;ponse est mise en cache.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;DnC s'est inspir&#233; de cette proposition de standard pour &#233;tendre les jetons accept&#233;s aux trois types &lt;a href='https://static.oa.dnc.global/-Gestion-du-jeton-d-acces-.html' class='spip_in'&gt;Access Token&lt;/a&gt;, &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jsonwebtokenjwt' class='spip_in'&gt;Identity Token (JWT)&lt;/a&gt; ou &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jwejsonwebencryption' class='spip_in'&gt;Json Web Encryption (JWE)&lt;/a&gt;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Point d'extr&#233;mit&#233; d'introspection&lt;/h3&gt;
&lt;p&gt;Point d'extr&#233;mit&#233; d'introspection (Introspection Endpoint)&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;https://oa.dnc.global/introspect&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;&lt;a id=&#034;oidcformedemandeintrospection&#034;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Forme de la demande d'Introspection&lt;/h3&gt;
&lt;p&gt;La demande ne doit &#234;tre effectu&#233;e que par la m&#233;thode POST.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OAuthSD ne n&#233;cessite pas l'enregistrement d'un scope r&#233;serv&#233; pour autoriser le client &#224; utiliser l'introspection, contrairement &#224; d'autres impl&#233;mentations. Le scope 'openid' est &#233;galement inutile, le controleur fonctionnant aussi bien dans le cadre de OAuth 2.0 que celui d'OpenID Connect.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Contr&#244;le de l'acc&#232;s&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Les demandes adress&#233;es au point de terminaison d'introspection doivent &#234;tre authentifi&#233;es avec les informations d'identification du client (Client Credentials Grant) ou autoris&#233;es avec un jeton d'acc&#232;s au porteur (Bearer Token).&lt;br class='autobr' /&gt;
En cons&#233;quence, l'application appelante (ou le serveur de ressource) doit &#234;tre enregistr&#233;e comme cliente sur le serveur d'authentification&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Client Credentials Grant&lt;/strong&gt;&lt;br class='autobr' /&gt;
C'est l'approche la plus simple et celle qui est recommand&#233;e. &lt;br class='autobr' /&gt;
L'application appelante (ou le serveur de ressource) doit &#234;tre enregistr&#233;e comme cliente sur le serveur d'authentification&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb5-1' class='spip_note' rel='appendix' title='OAuthSD autorise tous les clients enregistr&#233;s &#224; acc&#233;der au point de (...)' id='nh5-1'&gt;1&lt;/a&gt;]&lt;/span&gt;.&lt;br class='autobr' /&gt;
L'authentification est effectu&#233;e en utilisant l'authentification HTTP Basic (cf. section 2.3.1 de OAuth 2.0 [RFC6749]). Les identifiants client_id et client_secret sont ceux qui ont &#233;t&#233; d&#233;finis lors de l'inscription de l'application cliente sur le serveur.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bearer Token&lt;/strong&gt;&lt;br class='autobr' /&gt;
Cette approche n&#233;cessite un jeton d'acc&#232;s pour autoriser la demande d'introspection. &lt;br class='autobr' /&gt;
Pour un serveur de ressource, cela est plus compliqu&#233; du fait de la dur&#233;e limit&#233;e de validit&#233; du jeton d'acc&#232;s, contraignant &#224; une nouvelle demande de jeton. Une fa&#231;on d'obtenir un tel jeton consiste &#224; inscrire l'application pour le flux &lt;a href='https://static.oa.dnc.global/-Autorisation-de-serveur-a-serveur-Client-Credentials-Grant-.html#oauth20autorisationdeserveuraserveurexemplecomplet' class='spip_in'&gt;Client Credential Grant&lt;/a&gt;. &lt;br class='autobr' /&gt;
L'authentification est effectu&#233;e en passant le jeton dans l'en-t&#234;te Authorization de la demande d'introspection.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OAuthSD permet de sauter cette &#233;tape en r&#233;glant la constante de configuration AUTHENTICATE_INTROSPECT_REQUEST &#224; false.&lt;br class='autobr' /&gt;
De fait, la rfc indique que l'objectif de cette authentification client est &#034;Pour emp&#234;cher les attaques par balayage de jetons ...&#034;&lt;br class='autobr' /&gt;
Les attaques par balayage (scanning) pourraient &#234;tre mieux att&#233;nu&#233;es de certaines autres mani&#232;res, en particulier au niveau du r&#233;seau.&lt;br class='autobr' /&gt;
De plus, donner &#224; un client inconnu des informations sur la validit&#233; du jeton n'est pas un probl&#232;me de s&#233;curit&#233; &#233;lev&#233;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Requ&#234;te&lt;/h3&gt;
&lt;p&gt;Les param&#232;tre suivants doivent &#234;tre post&#233;s :&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;token&lt;/strong&gt; (OBLIGATOIRE) : le jeton &#224; valider. Les jetons soumis peuvent &#234;tre du type &lt;a href='https://static.oa.dnc.global/-Gestion-du-jeton-d-acces-.html' class='spip_in'&gt;Access Token&lt;/a&gt;, &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jsonwebtokenjwt' class='spip_in'&gt;Identity Token (JWT)&lt;/a&gt; ou &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jwejsonwebencryption' class='spip_in'&gt;Json Web Encryption (JWE)&lt;/a&gt;. &lt;br class='autobr' /&gt;
Si un jeton JWE est reconnu, il est d&#233;chiffr&#233; et le processus se poursuit avec la charge utile du JWE, qui n'est autre que le JWT.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; &lt;strong&gt;requester_ip&lt;/strong&gt; (OPTIONNEL) : Lorsque l'Introspection est demand&#233;e par une ressource prot&#233;g&#233;e (distincte de l'application cliente &#224; l'origine de l'authentification), il importe de ne pas r&#233;pondre &#224; un malware ayant intercept&#233; le jeton et tentant de le r&#233;-utiliser. &lt;br class='autobr' /&gt;
Pour cela, la ressource prot&#233;g&#233;e doit &lt;a href='https://static.oa.dnc.global/-Authentifier-l-application-.html#verificationdeloriginedelarequeterecueparunserveurderessource' class='spip_in'&gt;transmettre l'IP du demandeur au moyen du param&#232;tre 'requester_ip'&lt;/a&gt;.&lt;br class='autobr' /&gt;
La fonction d'introspection d'OAuthSD v&#233;rifie que l'IP indiqu&#233;e est celle qui a &#233;t&#233; enregistr&#233; avec l'application cliente ou, &#224; d&#233;faut, se trouve dans le sous r&#233;seau de l'application cliente tel qu'il peut &#234;tre d&#233;termin&#233; &#224; partir de l'URL de retour.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Notes :&lt;/strong&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OAuthSD ne n&#233;cessite pas le param&#232;tre token_type.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Avertissement &#224; propos du &lt;strong&gt;param&#232;tre 'alg'&lt;/strong&gt; : la RFC 7515, section 4.1.1 pr&#233;voit d'appliquer la valeur du param&#232;tre 'alg' pour le choix de l'algorithme de validation de la signature.&lt;br class='autobr' /&gt;
C'est une faille de s&#233;curit&#233; s&#233;v&#232;re, et donc une erreur de la sp&#233;cification. L'introspection d'OAuthSD applique la m&#233;thode d&#233;finie pour chaque application, avec laquelle les jetons sont sign&#233;s, quelle que soit la valeur de 'alg' et g&#233;n&#232;re une erreur si la valeur est diff&#233;rente.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;R&#233;ponse du serveur&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;En cas de succ&#232;s&lt;/strong&gt;, le serveur retourne une r&#233;ponse HTTP 200.&lt;/p&gt;
&lt;p&gt;Le corps de la r&#233;ponse contient un tableau portant les informations suivantes :&lt;/p&gt;
&lt;table class=&#034;spip&#034;&gt;
&lt;thead&gt;&lt;tr class='row_first'&gt;&lt;th id='ida5b2_c0'&gt; index &lt;/th&gt;&lt;th id='ida5b2_c1'&gt; type &lt;/th&gt;&lt;th id='ida5b2_c2'&gt; valeur &lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td headers='ida5b2_c0'&gt;status&lt;/td&gt;
&lt;td headers='ida5b2_c1'&gt;entier&lt;/td&gt;
&lt;td headers='ida5b2_c2'&gt;code HTTP&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td headers='ida5b2_c0'&gt;headers&lt;/td&gt;
&lt;td headers='ida5b2_c1'&gt;string&lt;/td&gt;
&lt;td headers='ida5b2_c2'&gt;Headers de la r&#233;ponse&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td headers='ida5b2_c0'&gt;page&lt;/td&gt;
&lt;td headers='ida5b2_c1'&gt;string&lt;/td&gt;
&lt;td headers='ida5b2_c2'&gt;JSON Array :&lt;br class='autobr' /&gt;
active : true,&lt;br class='autobr' /&gt;
scope : (JSON string Array) scopes associ&#233;s au jeton.&lt;br class='autobr' /&gt;
client_id : ID de l'application cliente qui a demand&#233; ce jeton.&lt;br class='autobr' /&gt;
username : ID OAuth de l'utilisateur final (human-readable).&lt;br class='autobr' /&gt;
exp : (long) (secondes depuis le 1&#176; janvier 1970). Unix Time de la fin de validit&#233; du jeton.&lt;br class='autobr' /&gt;
iat : (long) (secondes depuis le 1&#176; janvier 1970). Unix Time de cr&#233;ation du jeton&lt;br class='autobr' /&gt;
iss : (string) issuer : serveur d'authentification qui a diffus&#233; ce jeton.&lt;br class='autobr' /&gt;
sub : identifiant interne de l'utilisateur qui a autoris&#233; ce jeton.&lt;br class='autobr' /&gt;
aud : audience d&#233;finie pour ce jeton.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Si le jeton n'est pas valide&lt;/strong&gt;, alors que la requ&#234;te n'a pas &#233;chou&#233;, l'introspection ne retourne un code HTTP 200 et une r&#233;ponse active : false.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Le traitement des erreurs d'introspection d&#233;crit dans ce qui suit est propre &#224; cette version de OAuthSD, destin&#233;e au d&#233;veloppement et &#224; la mise au point d'une application mettant en oeuvre la d&#233;l&#233;gation d'authentification. Conform&#233;ment &#224; la sp&#233;cification, les serveurs OAuthSD de production ne donnent pas de d&#233;tail sur l'erreur, mais retournent simplement un code HTTP 401 et une r&#233;ponse active : false.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;En cas d'&#233;chec de la requ&#234;te&lt;/strong&gt;, le corps de la r&#233;ponse contient :&lt;/p&gt;
&lt;table class=&#034;spip&#034;&gt;
&lt;thead&gt;&lt;tr class='row_first'&gt;&lt;th id='id6d2b_c0'&gt; index &lt;/th&gt;&lt;th id='id6d2b_c1'&gt; type &lt;/th&gt;&lt;th id='id6d2b_c2'&gt; valeur &lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td headers='id6d2b_c0'&gt;page&lt;/td&gt;
&lt;td headers='id6d2b_c1'&gt;string&lt;/td&gt;
&lt;td headers='id6d2b_c2'&gt;JSON Array :&lt;br class='autobr' /&gt;
error : titre de l'erreur,&lt;br class='autobr' /&gt;
error_description : description de l'erreur&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;La r&#233;ponse HTTP ainsi que les valeurs de error et error_description sont donn&#233;es par le tableau suivant :&lt;/p&gt;
&lt;table class=&#034;spip&#034;&gt;
&lt;tbody&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td&gt;&lt;strong&gt;R&#233;ponse&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;error&lt;br class='autobr' /&gt;
titre de l'erreur&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;error_description&lt;br class='autobr' /&gt;
description de l'erreur&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Explication&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;invalid_request&lt;/td&gt;
&lt;td&gt;Only one method may be used to authenticate at a time (Auth header, GET or POST)&lt;/td&gt;
&lt;td&gt;La requ&#234;te est mal form&#233;e&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;invalid_request&lt;/td&gt;
&lt;td&gt;Missing parameters : &#034;token&#034; is required&lt;/td&gt;
&lt;td&gt;La requ&#234;te Introspection requiert le param&#232;tre 'token'.&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;invalid_request&lt;/td&gt;
&lt;td&gt;When putting the token in the body, the method must be POST or PUT&lt;/td&gt;
&lt;td&gt;Si on place le token dans le corps de la requ&#234;te, la m&#233;thode ne peut &#234;tre que POST ou PUT&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_odd odd'&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;invalid_request&lt;/td&gt;
&lt;td&gt;The content type for POST requests must be &#034;application/x-www-form-urlencoded&lt;/td&gt;
&lt;td&gt;l'IETF sp&#233;cifie ce type de contenu. NB : tous les serveurs Web ne remplissent pas cette variable _SERVER voir &lt;a href=&#034;http://tools.ietf.org/html/rfc6750#section-2.2&#034; class='spip_url spip_out auto' rel='nofollow external'&gt;http://tools.ietf.org/html/rfc6750#section-2.2&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr class='row_even even'&gt;
&lt;td&gt;401&lt;/td&gt;
&lt;td&gt;invalid_token&lt;/td&gt;
&lt;td&gt;JWT is malformed&lt;/td&gt;
&lt;td&gt;le jeton JWT ne peut &#234;tre d&#233;cod&#233;.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;h3 class=&#034;spip&#034;&gt;Exemples&lt;/h3&gt;
&lt;p&gt;Demande de validation d'un jeton d'identit&#233;, m&#233;thode Auth Header (ou &#034;JWT Bearer&#034; ) :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PHP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;/*&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;Autorisation avec OAuth Server by DnC&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;OpenID Connect : Introspection, m&#233;thode Auth Header &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;function&lt;/span&gt; oauth_authorize&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$Ok&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;!&lt;/span&gt;&lt;a href=&#034;http://www.php.net/empty&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/curl_init&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_init&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;AUTHENTICATION_SERVER_URL &lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'introspect'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/curl_setopt&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; CURLOPT_RETURNTRANSFER&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/curl_setopt&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; CURLOPT_TIMEOUT&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;10&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/curl_setopt&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; CURLOPT_HTTPHEADER&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/array&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'Authorization: Bearer '&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$response&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/curl_exec&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_exec&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;int&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;a href=&#034;http://www.php.net/curl_getinfo&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_getinfo&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'http_code'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;===&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;200&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$jwt&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/json_decode&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;json_decode&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$response&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$Ok&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$jwt&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'active'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$Ok&lt;/span&gt; AND &lt;a href=&#034;http://www.php.net/isset&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$_SERVER&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;HTTP_REFERER&#034;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$urlParts&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/parse_url&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;parse_url&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$_SERVER&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;HTTP_REFERER&#034;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$urlParts&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'host'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;!==&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$_SERVER&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;HTTP_HOST&#034;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// CORS : autoriser l'origine&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$issuer&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$urlParts&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'scheme'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;://&#034;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$urlParts&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'host'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; include_spip&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'inc/headers'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/header&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'Access-Control-Allow-Origin'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$issuer&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$Ok&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/f546d8239657ccedea95364e8ab2cb92.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Variante avec m&#233;thode GET pour SPIP :&lt;br class='autobr' /&gt;
&lt;strong&gt;SPIP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;/*&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;Autorisation avec OAuth Server by DnC&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;OpenID Connect : Introspection, m&#233;thode GET &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;function&lt;/span&gt; oauth_authorize&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$Ok&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;!&lt;/span&gt;&lt;a href=&#034;http://www.php.net/empty&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// Interroger l'introspection de OAuth Server by DnC&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; include_spip&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'inc/distant'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;http://oa.dnc.global/introspect?token=&#034;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$response&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; recuperer_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;int&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$response&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'status'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;===&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;200&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$jwt&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/json_decode&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;json_decode&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$response&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'page'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$jwt&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'active'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;a href=&#034;http://www.php.net/isset&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;isset&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$_SERVER&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;HTTP_ORIGIN&#034;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// Acc&#232;s HTTP (CORS) : autoriser l'origine&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; include_spip&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'inc/headers'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$issuer&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/trim&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;trim&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;a href=&#034;http://www.php.net/strtr&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;strtr&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$_SERVER&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;HTTP_ORIGIN&#034;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&lt;&gt;&#034;\''&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'[]##'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/header&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;header&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'Access-Control-Allow-Origin'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$issuer&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$Ok&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$Ok&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/f9ed3e05ef32d40e5354ea7f9e794a98.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Un exemple plus complet, faisant appara&#238;tre la totalit&#233; des erreurs possibles, figure ici : &lt;a href='https://static.oa.dnc.global/-OpenID-Connect-Autorisation-via-un-code-Authorization-Code-Flow-.html#openidconnectexemplescompletsdufluxdautorisationviauncodepuisrequeteuserinfo' class='spip_in'&gt;OpenID Connect : Exemples complets du flux d'Autorisation via un code puis requ&#234;te UserInfo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Notes :&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Dans le cas o&#249; l'application cliente et le serveur de donn&#233;es prot&#233;g&#233;es se trouvent dans des domaines diff&#233;rents, il faut g&#233;rer l'autorisation HTTP, comme cela est fait dans l'exemple ci-dessus. Voyez &lt;a href='https://static.oa.dnc.global/-Sujets-communs-a-Oauth-2-et-OpenID-Connect-.html#controledacceshttpcors' class='spip_in'&gt;Contr&#244;le d'acc&#232;s HTTP (CORS)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; L'interrogation du serveur d'autorisation &#224; chaque acc&#232;s d'une ressource prot&#233;g&#233;e peut le surcharger. Pour &#233;viter cela, on peut mettre en cache la r&#233;ponse du serveur du c&#244;t&#233; du serveur de ressource. Avec SPIP, c'est le r&#244;le de la fonction &lt;a href=&#034;http://code.spip.net/autodoc/tree/ecrire/inc/distant.php.html#function_recuperer_url_cache&#034; class='spip_out' rel='external'&gt;recuperer_url_cache()&lt;/a&gt; qui pourra remplacer &lt;a href=&#034;http://code.spip.net/autodoc/tree/ecrire/inc/distant.php.html#function_recuperer_url&#034; class='spip_out' rel='external'&gt;recuperer_url()&lt;/a&gt; dans l'exemple pr&#233;c&#233;dent. La fonction permet de r&#233;gler le d&#233;lai de garde en cache, qu'il convient de fixer &#224; une dur&#233;e assez courte (10 secondes par exemple), l'essentiel &#233;tant de ne pas bombarder le serveur. Voici un exemple :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SPIP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034; data-clipboard-text=&#034;$res = recuperer_url_cache( $url, array('delai_cache' =&gt; 10) ); // D&#233;lai de 10s&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$res&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; recuperer_url_cache&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;a href=&#034;http://www.php.net/array&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'delai_cache'&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&gt;&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;10&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// D&#233;lai de 10s&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;La fonction d&#233;crite pr&#233;c&#233;demment peut &#234;tre utilis&#233;e dans une fonction d'autorisation d'acc&#232;s &#224; un objet SPIP ( ici l'objet gis de radar ) :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SPIP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;function&lt;/span&gt; _autoriser_gis&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$faire&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$quoi&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$id&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$qui&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$options&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$qui&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'statut'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;==&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'0minirezo'&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// Toujours autoriser un administrateur&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;else&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$_GET&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'token'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// V&#233;rifier le jeton d'acc&#232;s&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; oauth_authorize&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$idtoken&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;else&lt;/span&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;false&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/537cdc13218065f5ea90df5df93ef8ca.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Il faut cependant noter que la mise en cache expose &#224; la r&#233;utilisation du jeton par un malware.&lt;/p&gt;
&lt;p&gt;Exemple d'appel, avec le jeton pass&#233; par la m&#233;thode Auth Header et le param&#232;tre '&lt;a href='https://static.oa.dnc.global/-Authentifier-l-application-.html#verificationdeloriginedelarequeterecueparunserveurderessource' class='spip_in'&gt;requester_ip&lt;/a&gt;' par Post :&lt;br class='autobr' /&gt;
&lt;strong&gt;PHP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// Method Bearer + parameters by Post&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$data&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/array&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'requester_ip'&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&gt;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$_SERVER&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'SERVER_ADDR'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$authorization&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;Authorization: Bearer &#034;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$res1&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'id_token'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/curl_init&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_init&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$introspection_endpoint&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/curl_setopt&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; CURLOPT_HTTPHEADER&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;a href=&#034;http://www.php.net/array&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'Content-Type: application/x-www-form-urlencoded'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'Authorization: Bearer '&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$id_token&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/curl_setopt&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; CURLOPT_RETURNTRANSFER&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;true&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/curl_setopt&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; CURLOPT_POST&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;1&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;a href=&#034;http://www.php.net/curl_setopt&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;curl_setopt&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$h&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; CURLOPT_POSTFIELDS&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;a href=&#034;http://www.php.net/http_build_query&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;http_build_query&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$data&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #339933;&#034;&gt;...&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/e13c64904e5aa04d40a6454be3c83ff8.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;&lt;a id=&#034;avantages&#034;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Avantages et inconv&#233;nients de l'Introspection&lt;/h3&gt;
&lt;p&gt;La validation du jeton d'identit&#233; (ID Token) aupr&#232;s du serveur d'authentification (introspection) pr&#233;sente quatre avantages importants : &lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; elle permet de &lt;strong&gt;savoir si le jeton a &#233;t&#233; r&#233;voqu&#233;&lt;/strong&gt;, contrairement &#224; la validation locale ; c'est l&#224; un avantage fondamental pour la s&#233;curit&#233; : si vous d&#233;cidez de r&#233;voquer un jeton d'acc&#232;s, alors il faut bien que les applications r&#233;agissent, le seul moyen est l'introspection.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; cette m&#233;thode ne n&#233;cessite pas de conna&#238;tre la cl&#233; publique de l'application cliente pour valider la signature du jeton, ce qui permet &#224; des serveurs de ressource &#233;trangers &#224; l'organisation de valider les jetons re&#231;us ;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; on peut obtenir des informations sur l'utilisateur final (qui est &#224; l'origine de l'autorisation) qui permettent d'identifier cet utilisateur et, donc, d'agir en fonction de la confiance &#224; accorder d'apr&#232;s son profil ;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; il est possible de mettre en &#339;uvre la d&#233;claration &#034;jti&#034; (JWT ID) qui permet au serveur d'autorisation de v&#233;rifier que le jeton n'a pas d&#233;j&#224; &#233;t&#233; utilis&#233; ;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; OAuthSD propose &#233;galement la v&#233;rification de l'IP du demandeur : si une ressource prot&#233;g&#233;e a transmis l'adresse IP de son propre demandeur avec le param&#232;tre 'requester_ip', on v&#233;rifie que cette adresse IP se trouve dans le sous-r&#233;seau de l'application cliente identifi&#233;e par la d&#233;claration 'aud'. Cela est essentiel pour ne pas r&#233;pondre &#224; un malware ayant intercept&#233; le jeton.&lt;/p&gt;
&lt;p&gt;Elle a pour seul inconv&#233;nient d'augmenter le trafic avec le serveur d'autorisation.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Remarque quant au lien entre jeton d'identit&#233; et jeton d'acc&#232;s et l'int&#233;r&#234;t r&#233;el de ce dernier&lt;/h3&gt;
&lt;p&gt;Justin Richer : (&lt;a href=&#034;http://lists.openid.net/pipermail/openid-specs-ab/Week-of-Mon-20130909/003951.html&#034; class='spip_out' rel='external'&gt;openid-specs-ab&lt;/a&gt;)&lt;/p&gt;
&lt;blockquote class=&#034;spip&#034;&gt;
&lt;p&gt;&lt;i&gt;&#034;Il n'y a pas de relation 1:1 entre le jeton d'acc&#232;s et jeton d'identit&#233; (ID Token), surtout si vous consid&#233;rez que le jeton d'acc&#232;s peut &#234;tre actualis&#233; ou ne pas expirer, alors que le jeton d'identit&#233; doit expirer. Le ID Token repr&#233;sente l'&#233;v&#233;nement authn (et la session, dans une certaine mesure), alors que le jeton d'acc&#232;s repr&#233;sente une autorisation d&#233;l&#233;gu&#233;e d'acc&#232;s aux informations de profil de l'utilisateur. Vous pouvez obtenir des informations sur l'&#233;v&#233;nement d'authentification qui a g&#233;n&#233;r&#233; le jeton d'acc&#232;s &#224; partir de l'introspection, mais il est important de se rappeler que le jeton d'acc&#232;s n'est pas destin&#233; &#224; &#234;tre &#233;troitement li&#233; &#224; cet &#233;v&#233;nement d'authentification. En fait, c'est toute la question d'OAuth qui lie de fa&#231;on l&#226;che l'authentification au jeton d'acc&#232;s et maintient le jeton d'acc&#232;s valide alors que l'utilisateur n'est plus l&#224;.&lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Cette remarque &#224; propos de la faiblesse du lien entre jeton d'acc&#232;s et jeton d'identit&#233; rejoint la conclusion &#233;mise &#224; propos de la &lt;a href='https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#demandedinformationssurlutilisateuruserinfoendpoint' class='spip_in'&gt;requ&#234;te Userinfo&lt;/a&gt; : toute requ&#234;te Userinfo devrait suivre le cycle : demande d'autorisation, validation du ID Token, demande Userinfo, v&#233;rification de la concordance des user_id. C'est ce qui est d&#233;crit dans les &lt;a href='https://static.oa.dnc.global/-OpenID-Connect-Autorisation-via-un-code-Authorization-Code-Flow-.html#openidconnectexemplescompletsdufluxdautorisationviauncodepuisrequeteuserinfo' class='spip_in'&gt;exemples&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Que vaut r&#233;ellement un jeton d'acc&#232;s si :
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; on ne peut v&#233;rifier sa validit&#233; sans introspection&lt;span class=&#034;spip_note_ref&#034;&gt; [&lt;a href='#nb5-2' class='spip_note' rel='appendix' title='Une piste consiste &#224; Emettre un jeton d'acc&#232;s en tant que JWT.' id='nh5-2'&gt;2&lt;/a&gt;]&lt;/span&gt; (autant alors faire l'introspection pour le jeton d'identit&#233;),
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; on n'est pas certain du lien avec le jeton d'identit&#233; ?&lt;/p&gt;
&lt;p&gt;Plus g&#233;n&#233;ralement, ne devrait-on pas conclure ainsi : &lt;strong&gt;plut&#244;t que d'utiliser le jeton d'acc&#232;s ne vaudrait-il pas mieux utiliser exclusivement le jeton d'identit&#233; ?&lt;/strong&gt; C'est pour cela qu'il existe un flux OpenID Connect ne retournant que l'ID Token.&lt;/p&gt;&lt;/div&gt;
		&lt;hr /&gt;
		&lt;div class='rss_notes'&gt;&lt;div id='nb5-1'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh5-1' class='spip_note' title='Notes 5-1' rev='appendix'&gt;1&lt;/a&gt;] &lt;/span&gt;OAuthSD autorise tous les clients enregistr&#233;s &#224; acc&#233;der au point de terminaison d'introspection. Il est donc inutile de sp&#233;cifier un scope ou une m&#233;tadonn&#233;e particuliers.&lt;/p&gt;
&lt;/div&gt;&lt;div id='nb5-2'&gt;
&lt;p&gt;&lt;span class=&#034;spip_note_ref&#034;&gt;[&lt;a href='#nh5-2' class='spip_note' title='Notes 5-2' rev='appendix'&gt;2&lt;/a&gt;] &lt;/span&gt;Une piste consiste &#224; &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#emettreunjetondaccesentantquejwt' class='spip_in'&gt;Emettre un jeton d'acc&#232;s en tant que JWT&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>API OpenId Connect : Point d'extr&#233;mit&#233; d'informations sur les clefs (Keys Endpoint)</title>
		<link>https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectpointdextremitedinformationssurlesclefskeysendpoint</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html#apiopenidconnectpointdextremitedinformationssurlesclefskeysendpoint</guid>
		<dc:date>2021-04-14T10:15:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;Le protocole OpenID Connect utilise un jeton d'identit&#233; (ID Token) fond&#233; sur JWT. La norme d&#233;crit comment une application cliente doit valider un ID Token re&#231;u en r&#233;ponse &#224; une demande d'authentification. Cette v&#233;rification peut se faire localement (ou sinon par introspection), ce qui n&#233;cessite d'acc&#233;der aux informations sur les cl&#233;s publiques. &lt;br class='autobr' /&gt;
C'est ce que permet le &lt;br class='autobr' /&gt;
Point d'extr&#233;mit&#233; d'informations sur les clefs (Keys Endpoint) &lt;br class='autobr' /&gt;
https://oa.dnc.global/keys &lt;br class='autobr' /&gt;
Forme de la demande d'informations sur les cl&#233;s (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-API-OpenID-Connect-Points-d-extremite-.html" rel="directory"&gt;API OpenID Connect : Points d'extr&#233;mit&#233;&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L128xH128/arton57-692a7.png?1733821221' width='128' height='128' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;Le protocole OpenID Connect utilise un &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jsonwebtokenjwt' class='spip_in'&gt;jeton d'identit&#233; (ID Token) fond&#233; sur JWT&lt;/a&gt;. La norme d&#233;crit comment une application cliente doit &lt;a href='https://static.oa.dnc.global/-OpenID-Connect-6-.html#validationdujetondidentiteidtokenjwtsigneoujws' class='spip_in'&gt;valider un ID Token&lt;/a&gt; re&#231;u en r&#233;ponse &#224; une demande d'authentification. Cette v&#233;rification peut se faire localement (ou sinon par introspection), ce qui n&#233;cessite d'acc&#233;der aux informations sur les cl&#233;s publiques.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;p&gt;C'est ce que permet le&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Point d'extr&#233;mit&#233; d'informations sur les clefs (Keys Endpoint)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code class='spip_code' dir='ltr'&gt;https://oa.dnc.global/keys&lt;/code&gt;&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;Forme de la demande d'informations sur les cl&#233;s&lt;/h3&gt;
&lt;p&gt;La demande ne doit &#234;tre effectu&#233;e que par la m&#233;thode POST.&lt;/p&gt;
&lt;p&gt;Le client doit inclure ses informations d'authentification telles que d&#233;crites &#224; la section 2.3. du document [RFC6749].&lt;/p&gt;
&lt;p&gt;Exemple de requ&#234;te :&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;POST /keys HTTP/1.1&lt;br /&gt; Host: oa.dnc.global&lt;br /&gt; Content-Type: application/x-www-form-urlencoded&lt;br /&gt; Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW&lt;/code&gt;&lt;/div&gt;&lt;h3 class=&#034;spip&#034;&gt;R&#233;ponse&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;En cas de succ&#232;s&lt;/strong&gt; le serveur retourne une r&#233;ponse HTTP 200.&lt;br class='autobr' /&gt;
Le corps de la r&#233;ponse contient une liste de d&#233;finitions des cl&#233;s publiques.&lt;/p&gt;
&lt;p&gt;Chaque d&#233;finition de cl&#233; est repr&#233;sent&#233;e sous un format JSON telle que d&#233;fini dans le document &lt;a href=&#034;https://tools.ietf.org/html/rfc7517&#034; class='spip_out' rel='external'&gt;JSON Web Key (JWK)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Exemple&lt;/strong&gt;&lt;br class='autobr' /&gt;
Voici un exemple de r&#233;ponse au format JSON :&lt;br class='autobr' /&gt;
&lt;strong&gt;[JSON]&lt;/strong&gt;&lt;/p&gt;
&lt;div style='text-align: left;' class='spip_code' dir='ltr'&gt;&lt;code&gt;{&#034;keys&#034;:[{&lt;br /&gt; &#034;kid&#034;:&#034;618584200ef916a154008d898a1e7edc&#034;,&lt;br /&gt; &#034;kty&#034;:&#034;RSA&#034;,&lt;br /&gt; &#034;alg&#034;:&#034;RS256&#034;,&lt;br /&gt; &#034;use&#034;:&#034;sig&#034;,&lt;br /&gt; &#034;e&#034;:&#034;AQAB&#034;,&lt;br /&gt; &#034;n&#034;:&#034;ykcWIXjQ-f61XCJutT4JcgpmmobtB0U7ZcejT8tBD8rOZPkQDYf0Q3pMjCkNT8RRKzMYtkelY2CNn3U7kVJMgbJAtvZsCdlChVHAKvRnjwh1GR_6Zpmajm5cuz4bjQWWUIPIoXe_4JbC8nCrHdaagzB_6PrV_NILyn5unG1RLOrWx7_yzLaterDKxHTCBeOlqv_5VGFey0Ecf-X7Bj8YRx6fpamK4BcEAZSAbZMtAnTckp3hOYJgZo3MOXDxSQw1YR83i5Udcoaf7sxfhEA_b7r9CeNfgj76MKM7sdCfBMI7_JSz-YU_pJKCuT9Ny3IJQ0fQHpDzSq2oD_3cDcLjfXTGM67rXElwr9l8yrSNa29UGK4q2u9cFCQmJGlxVhZU6bzs7l4202LTJdPlzm_29jwLVvtqnVJSovMLHx84ReFtus1RdKRGB2plDQccvBNvp92D9lOnM3bAu1fKRAJwNh3hg1d6k7MVCHxoo9HVnkxzW48rAAJE2nk44a2Y0cclufBhvKRdNavldS1XOyZ_qf3qCAzsuYF1VAga8I-QOb6OyXp0KGLptbyYD-ZXISGPw3pDD3aAof_PMfFhSB96GHDnm-UCRpFHndQ_fZgtZhWugU8z22rV-irYCySqVkpE0ToWbNXNFZ9Jo1GXdwkpi1WjB7S-ipjzRFOlxhwbvZ0&#034;},&lt;br /&gt; ...&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;kid&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Comme diff&#233;rentes applications clientes peuvent utiliser la m&#234;me paire de cl&#233; publique/priv&#233;e, les cl&#233;s sont index&#233;es par un identifiant &#034;kid&#034; plut&#244;t que par un client_id.&lt;/p&gt;
&lt;p&gt;Cet identifiant est notamment pr&#233;sent dans la charge utile du &lt;a href='https://static.oa.dnc.global/-JSON-Web-Token-JWT-JWS-.html#jsonwebtokenjwt' class='spip_in'&gt;jeton JWT&lt;/a&gt;, ce qui permettra de s&#233;lectionner la cl&#233; publique n&#233;cessaire pour &lt;a href='https://static.oa.dnc.global/-OpenID-Connect-6-.html#validationdujetondidentiteidtokenjwtsigneoujws' class='spip_in'&gt;valider la signature du jeton JWT&lt;/a&gt;.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt; jwks_uri, fichier jwks.json&lt;/h3&gt;
&lt;p&gt;La norme pr&#233;voit que le document de d&#233;couverte .well-known/openid_configuration d&#233;finisse une constante jwks_uri donnant l'URL du fichier jwks.json, sous la forme :&lt;br class='autobr' /&gt;
&lt;code class='spip_code' dir='ltr'&gt;&#034;jwks_uri&#034; : &#034;https://oa.dnc.global/jwks/jwks.json&#034;,&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Cette URL permet d'obtenir la m&#234;me information que par le Point d'extr&#233;mit&#233; d'informations sur les clefs. Cependant, ces donn&#233;es sont statiques, alors que l'appel au contr&#244;leur Keys recalcule le fichier jwks.json &#224; chaque fois afin de prendre en compte un &#233;ventuel changement.&lt;/p&gt;
&lt;h3 class=&#034;spip&#034;&gt;UpdatekeysController&lt;/h3&gt;
&lt;p&gt;OAuthSD propose un point d'entr&#233;e &#034;updatekeys&#034; qui provoque le re-calcul des paires de cl&#233;s publiques-priv&#233;es de tous les clients ainsi que la mise &#224; jour des informations sur les cl&#233;s.&lt;br class='autobr' /&gt;
Ce contr&#244;leur n'est accessible qu'&#224; partir de la m&#234;me adresse que le serveur et sera donc soit lanc&#233; localement par le Superviseur soit par une t&#226;che CRON &#224; l'aide de wget.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Notes :&lt;/strong&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Outre le fichier jwks.json, le dossier /jwks contient un fichier au format JSON pour chaque cl&#233; publique, sous le nom &lt;code class='spip_code' dir='ltr'&gt;&lt;kid&gt;.json&lt;/code&gt;.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Compte-tenu de la charge de calcul n&#233;cessaire &#224; l'&#233;tablissement du fichier, l'appel au point d'extr&#233;mit&#233; Keys doit &#234;tre r&#233;serv&#233; &#224; des applications de confiance ou &#234;tre prot&#233;g&#233; contre les attaques de type d&#233;ni de service.
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Pour &#233;viter le recalcul du fichier jwks.json &#224; chaque appel de Keys, il est possible de modifier la r&#232;gle de r&#233;&#233;criture dans le fichier .htaccess pour :&lt;br class='autobr' /&gt;
&lt;code class='spip_code' dir='ltr'&gt;RewriteRule ^keys /jwks/jwks.json [QSA,L]&lt;/code&gt;
&lt;br /&gt;&lt;img src='https://static.oa.dnc.global/local/cache-vignettes/L8xH11/puce-32883.gif?1733817730' width='8' height='11' class='puce' alt=&#034;-&#034; /&gt; Une cl&#233; publique peut &#233;galement &#234;tre lue au moyen de l'&lt;a href='https://static.oa.dnc.global/-Techniques-et-code-du-serveur-OAuthSD-.html#apihttpresttreeql' class='spip_in'&gt;API HTTP REST + TreeQL&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>
<item xml:lang="fr">
		<title>Lien de (re)connexion</title>
		<link>https://static.oa.dnc.global/-OpenID-Connect-Autorisation-via-un-code-Authorization-Code-Flow-.html#liendereconnexion</link>
		<guid isPermaLink="true">https://static.oa.dnc.global/-OpenID-Connect-Autorisation-via-un-code-Authorization-Code-Flow-.html#liendereconnexion</guid>
		<dc:date>2021-04-02T15:30:00Z</dc:date>
		<dc:format>text/html</dc:format>
		<dc:language>fr</dc:language>
		<dc:creator>DnC</dc:creator>



		<description>
&lt;p&gt;Il peut &#234;tre utile de permettre &#224; un utilisateur de se connecter sans passer par une proc&#233;dure d'identification. Par exemple lorsque le login ou le mot de passe a &#233;t&#233; perdu et pour &#233;viter la fastidieuse proc&#233;dure de r&#233;cup&#233;ration du &#034;mot de passe oubli&#233;&#034;. &lt;br class='autobr' /&gt;
Nous d&#233;crivons ici comment cr&#233;er un lien de reconnexion qui pourra, par exemple, &#234;tre adress&#233; &#224; l'utilisateur dans un e-mail. &lt;br class='autobr' /&gt;
Plut&#244;t que faire figurer le jeton d'identit&#233; dans le lien, qui peut &#234;tre trop grand pour &#234;tre pass&#233; en URL, on prendra l'ID Token (...)&lt;/p&gt;


-
&lt;a href="https://static.oa.dnc.global/-OpenID-Connect-Autorisation-via-un-code-Authorization-Code-Flow-.html" rel="directory"&gt;OpenID Connect : Autorisation via un code (Authorization Code Flow)&lt;/a&gt;


		</description>


 <content:encoded>&lt;img class='spip_logo spip_logo_right spip_logos' alt=&#034;&#034; style='float:right' src='https://static.oa.dnc.global/local/cache-vignettes/L128xH128/arton216-26f9e.png?1733819294' width='128' height='128' /&gt;
		&lt;div class='rss_chapo'&gt;&lt;p&gt;Il peut &#234;tre utile de permettre &#224; un utilisateur de se connecter sans passer par une proc&#233;dure d'identification. Par exemple lorsque le login ou le mot de passe a &#233;t&#233; perdu et pour &#233;viter la fastidieuse proc&#233;dure de r&#233;cup&#233;ration du &#034;mot de passe oubli&#233;&#034;.&lt;/p&gt;
&lt;p&gt;Nous d&#233;crivons ici comment cr&#233;er un lien de reconnexion qui pourra, par exemple, &#234;tre adress&#233; &#224; l'utilisateur dans un e-mail.&lt;/p&gt;&lt;/div&gt;
		&lt;div class='rss_texte'&gt;&lt;p&gt;Plut&#244;t que faire figurer le jeton d'identit&#233; dans le lien, qui peut &#234;tre trop grand pour &#234;tre pass&#233; en URL, on prendra l'ID Token dans une table o&#249; il se trouve index&#233; par son hash, et ce sera cette valeur qui sera pass&#233;e dans le lien de reconnexion.&lt;/p&gt;
&lt;p&gt;En t&#234;te de chaque page pouvant &#234;tre appel&#233;e avec reconnexion, on appellera avec :&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_spip code&#034; data-clipboard-text=&#034;&#034;&gt;&lt;div class=&#034;spip&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #222&#034;&gt;&lt;INCLURE&lt;span style=&#034;color: #74B900;&#034;&gt;{fond=inclure/autoconnect}&lt;/span&gt;&lt;span style=&#034;color: #74B900;&#034;&gt;{env}&lt;/span&gt;&lt;/span&gt;&lt;span style=&#034;color: #222;&#034;&gt;&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;la noisette suivante :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SPIP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_spip code&#034;&gt;&lt;div class=&#034;spip&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;[&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;(&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;#REM&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;)&lt;/span&gt; 150b Autoconnect : connexion OIDC avec la m&#233;thode id_token_hint &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;Remplace la noisette identification pour assurer l'authentification avec l'ID Token pass&#233; par le param&#232;tre d'URL token&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;auteur : B.Degoy i-Tego&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;licence : GNU/GPL&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;[&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;(&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;#ENV&lt;/span&gt;&lt;span style=&#034;color: #74B900;&#034;&gt;{token}&lt;/span&gt;&lt;span style=&#034;color: #FF851D;&#034;&gt;|autoconnect&lt;/span&gt;&lt;span style=&#034;color: #74B900;&#034;&gt;{&lt;span style=&#034;color: #D05000;&#034;&gt;#SELF&lt;/span&gt;}&lt;/span&gt;&lt;span style=&#034;color: #FF851D;&#034;&gt;|non&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #D05000;&#034;&gt;[&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;(&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;#SESSION&lt;/span&gt;&lt;span style=&#034;color: #74B900;&#034;&gt;{id_auteur}&lt;/span&gt;&lt;span style=&#034;color: #FF851D;&#034;&gt;|non&lt;/span&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #C90&#034;&gt;&lt;:oauth:vous_devez_vous_identifier:&gt;&lt;/span&gt;.&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #C90&#034;&gt;&lt;:oauth:vous_pas_compte:&gt; &lt;a href=&#034;./spip.php?page=inscription&amp;lang=&lt;span style=&#034;color: #D05000;&#034;&gt;#ENV&lt;/span&gt;&lt;span style=&#034;color: #74B900;&#034;&gt;{lang}&lt;/span&gt;&#034;&gt;&lt;:oauth:creer_compte_auteur:&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;br /&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #D05000;&#034;&gt;#LOGIN_PUBLIC&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #D05000;&#034;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #D05000;&#034;&gt;]&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/2ef80c2ab7d129ec43abc6df97ece4ed.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Voici le code du filtre autoconnect :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PHP SPIP&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#034;coloration_code code&#034;&gt;&lt;div class=&#034;spip_php code&#034;&gt;&lt;div class=&#034;php&#034;&gt;&lt;ol&gt;&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;&lt;?php&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * Autoconnect pour DnC SaaS (base SPIP)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * @auteur : B.Degoy i-Tego&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * SPIP, Systeme de publication pour l'internet &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * Copyright (c) 2001-2020&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * Ce programme est un logiciel libre distribue sous licence GNU/GPL. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt; * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;*/&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;//[dnc150b]&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;* Lancer une (re)connexion par la m&#233;thode OIDC id_token_hint avec le token fourni.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;* Ceci suppose que la derni&#232;re connexion de l'utilisateur ait &#233;t&#233; enregistr&#233;e dans la table jwt.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;* La table jwt est index&#233;e par le hash de l'ID Token. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;* C'est cette valeur, plus courte que l'ID token lui-m&#234;me, qui est pass&#233;e dans l'URL d'autoconnexion.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;* &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;* @param mixed $idt_hash : le hash de l'ID Token &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009933; font-style: italic;&#034;&gt;*/&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #000000; font-weight: bold;&#034;&gt;function&lt;/span&gt; filtre_autoconnect_dist&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$idt_hash&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt;&lt;span style=&#034;color: #009900; font-weight: bold;&#034;&gt;null&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;//DebugBreak(&#034;435347910947900005@127.0.0.1;d=1&#034;); //DEBUG&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// R&#233;cup&#233;rer l'ID Token et le client avec idt_hash&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; include_spip&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'base/abstract_sql'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$res&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; sql_fetsel&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'client_id, id_token'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'spip_jwt'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'idt_hash='&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;.&lt;/span&gt; sql_quote&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$idt_hash&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;!&lt;/span&gt; &lt;a href=&#034;http://www.php.net/is_null&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;is_null&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$res&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// G&#233;n&#233;rer un state &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; include_spip&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'inc/session'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$state&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/md5&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;md5&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$idt_hash&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$state&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;a href=&#034;http://www.php.net/substr&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$state&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;0&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #cc66cc;&#034;&gt;16&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; session_set&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'state'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$state&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// Page &#224; laquelle rediriger apr&#232;s l'authentification.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;if&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt; &lt;a href=&#034;http://www.php.net/empty&#034;&gt;&lt;span style=&#034;color: #990000;&#034;&gt;empty&lt;/span&gt;&lt;/a&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'./'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'token'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;''&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// sans le token &#233;videmment (car il ne sera plus valide apr&#232;s la (re)connexion.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; session_set&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'caller'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// voir plugin oidcclient : oidc_setps.php.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// lancer une (re)connexion par la m&#233;thode OIDC id_token_hint&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'/authorize'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'response_type'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'code'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&amp;'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'scope'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'openid sli'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&amp;'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'prompt'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'none'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&amp;'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'client_id'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$res&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'client_id'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&amp;'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'state'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$state&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&amp;'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'url'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$url&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&amp;'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt; &lt;span style=&#034;color: #339933;&#034;&gt;=&lt;/span&gt; parametre_url&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'id_token_hint'&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #000088;&#034;&gt;$res&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'id_token'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;,&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;'&amp;'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; include_spip&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #0000ff;&#034;&gt;'inc/headers'&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; redirige_par_entete&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&#034;color: #000088;&#034;&gt;$redirect&lt;/span&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;else&lt;/span&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#123;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// idt_hash non valide ou erreur plus g&#233;n&#233;rale.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #b1b100;&#034;&gt;return&lt;/span&gt; &lt;span style=&#034;color: #0000ff;&#034;&gt;&#034;&#034;&lt;/span&gt;&lt;span style=&#034;color: #339933;&#034;&gt;;&lt;/span&gt; &lt;span style=&#034;color: #666666; font-style: italic;&#034;&gt;// pour faire &#233;chouer le test&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li style=&#034;font-weight: normal; vertical-align:top;&#034;&gt;&lt;div style=&#034;&#034;&gt;&lt;span style=&#034;color: #009900;&#034;&gt;&#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class='download code_download'&gt;&lt;a href='https://static.oa.dnc.global/local/cache-code/7f5f4195b8cc3621de588507f2dad2a0.txt'&gt;T&#233;l&#233;charger&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Cette proc&#233;dure de reconnexion revient exactement &#224; une nouvelle connexion de l'utilisateur. Cela veut dire en particulier que le cookie SLI et les jetons seront r&#233;g&#233;n&#233;r&#233;s.&lt;/p&gt;
&lt;p&gt;Comme le jeton d'identit&#233; change, son hash change et il en r&#233;sulte que le jeton pass&#233; dans le lien de reconnexion est &#224; usage unique.&lt;/p&gt;&lt;/div&gt;
		
		</content:encoded>


		

	</item>



</channel>

</rss>
