Table des matières

🇫🇷 Français | 🇬🇧 English


OpenID Connect

Objective

L’Identité Numérique La Poste is based on the OpenID Connect (OIDC) protocol.

This standard allows a partner service to:


General Principle

The partner does not manage authentication directly.

👉 Instead, it redirects the user to LINLP, which:


Flow Overview

The standard flow is as follows:

  1. Call the `/authorize` endpoint
  2. User authentication (mobile)
  3. Redirection with an authorization code
  4. Call the `/token` endpoint
  5. Retrieve tokens
  6. Call the `/userinfo` endpoint
  7. Retrieve user data

LINLP OIDC


Main Endpoints

Endpoint Description
/authorize User authentication
/token Token retrieval
/userinfo User data retrieval

Step 1: /authorize

The partner redirects the user to LINLP.

Main parameters:

Example:

GET /authorize?response_type=code
&client_id=XXX
&redirect_uri=https://myservice.com/callback
&scope=openid+profile+email

👉 The user is then authenticated through the mobile application.


Step 2: Authorization code retrieval

After authentication:

Example:

https://myservice.com/callback?code=ABC123

⚠️ This code is temporary and single-use.


Step 3: /token

The partner backend exchanges the code for tokens.

POST /token

Parameters:

👉 This step must be performed server-side.


Step 4: Returned tokens

LINLP returns:


Step 5: /userinfo

The partner retrieves user data:

GET /userinfo
Authorization: Bearer access_token

👉 Returned data depends on the requested scopes.


Tokens

ID Token (JWT)

The id_token contains:

👉 It must be verified using the LINLP public key.


Access Token

The access_token allows:


Best Practices

⚠️ Backend required Never expose `client_secret` on the frontend.

⚠️ No iframe The `/authorize` page must be called through redirection.

⚠️ Token validation Always verify the JWT signature.

⚠️ Secure storage Tokens must be securely stored.


Environments


Key Takeaways


Next Step

👉 Implement the full flow:

Authorization Code Flow