ajout de l'authentification SSO/A5L
This commit is contained in:
20
public/callback.html
Normal file
20
public/callback.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
// Récupération du code dans l'URL
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const code = urlParams.get('code');
|
||||
|
||||
if (code) {
|
||||
// Ici, normalement, on échange le code contre un token via un fetch vers l'IdP
|
||||
// Pour l'exemple, on simule la réussite :
|
||||
localStorage.setItem('auth_token', 'session_active_' + btoa(code));
|
||||
window.location.href = 'index.html';
|
||||
} else {
|
||||
document.body.innerHTML = "Erreur d'authentification. Redirection...";
|
||||
setTimeout(() => window.location.href = 'index.html', 2000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user