authentification
user
documents
erreurs IAM
mode local ou remote on force toujours le mode d'authentification pour éviter les erreurs de configuration
state session
code verificated
code
token
routing: si true, les redirectUri utilisent les routes /login et /logout
Get Fetch
Set Fetch
fetch instance to sets
Save the current service state to the store
Throw an error
Check if the service is pending
Get emitter instance used to dispatch global events.
Set emitter instance used to dispatch global events.
Verifie la session Keycloak en utilisant (iframe)
oauth2 or keycloak
Check if the access is valid
Get the access token
Check if the authentificate is already done locally
Check if the authentificate is really done
IAM pour se connecter
// requête :
https://sso.geopf.fr/realms/geoplateforme/protocol/openid-connect/auth?
scope=openid%20profile%20email&
response_type=code&
approval_prompt=auto&
redirect_uri=http%3A%2F%2Flocalhost%3A5173%2Fcartes.gouv.fr-entree-carto/login&
client_id=IAM_CLIENT_ID
// réponse avec redirection :
http://localhost:5173/cartes.gouv.fr-entree-carto/login?
session_state=968321a6-385e-4058-a17a-571ab08303bd&
iss=https%3A%2F%2Fsso.geopf.fr%2Frealms%2Fgeoplateforme&
code=168e7dd8-ae1f-4f8b-99f7-ae0aac066067.968321a6-385e-4058-a17a-571ab08303bd.3038d336-2dfa-4c2e-954e-090ee781ed7f
IAM pour se deconnecter
// requête :
https://sso.geopf.fr/realms/geoplateforme/protocol/openid-connect/logout?
post_logout_redirect_uri=http%3A%2F%2Flocalhost%3A5173%2Fcartes.gouv.fr-entree-carto/logout&
scope=profile%20email&
response_type=code&
approval_prompt=auto&
client_id=IAM_CLIENT_ID
// réponse avec redirection :
http://localhost:5173/cartes.gouv.fr-entree-carto/?
session_state=968321a6-385e-4058-a17a-571ab08303bd
Not used ! Indique si le token est expiré depuis plus de 12h.
ServiceLocal est une implémentation de ServiceBase qui gère l'authentification via OAuth2 en mode local.
Il utilise la librairie @badgateway/oauth2-client pour gérer le flux d'authentification OAuth2 avec PKCE.
Le mode local implique que l'application gère directement le flux d'authentification avec le serveur IAM (ex. Keycloak) sans passer par une API intermédiaire.