My place in the WordPress community
- I have had a wordpress.org account since 2006.
- I contributed to WordPress core for versions 7.0 and 7.1.
- I maintain 30 plugins on wordpress.org.
- I organise and speak at WordCamps.
- I have attended every WordCamp Europe from 2017 to 2026.
- Local WordPress meetup: Marseille WordPress Meetup
Many French public tools need one login for agents of very different organisations, and the state offers it as ProConnect. The partner documentation is thorough, so this page does not repeat it. It follows the documented path in the order a Next.js developer meets it and flags where the framework needs a decision. I am Mariusz Szatkowski, a Gdynia-based developer, and all work happens remotely by email. I read the documentation in French and quote it in my own translation. Contract and data protection questions stay with your authority or counsel.

The Vieux-Port in Marseille. Photograph by Clément Bardot, CC BY-SA 4.0, from Wikimedia Commons.
What is ProConnect login?
A user clicks the ProConnect button on a service and types a work email address. ProConnect redirects the user to the identity provider of that organisation, called “fournisseur d’identité” (FI) in the documentation. If the email domain has no known identity provider, the user creates a “ProConnect Identité” account with email and password. After login the user returns to ProConnect and then to the service, which the documentation calls “fournisseur de service” (FS). In OpenID Connect terms, ProConnect is the provider and your Next.js app is the client.
The documentation’s own example hosts still carry the AgentConnect name, for example in the integration domain and in logout samples. If an old tender or library uses that name, check it against the current ProConnect documentation before relying on it.
Who may integrate it?
The eligibility page says any administration may add the button. Software publishers working for a public entity can submit the request on that entity’s behalf, naming the data controller and the data protection officer. Private organisations may use it only to authenticate public-sector staff, so private professionals cannot log into a private application through it. The documentation’s example is a publisher that builds an appointment tool for local authorities, where municipal staff log in with their professional accounts.
Some people are not covered. The coverage page lists students other than civil-servant students, and professionals without a SIRET: representatives of foreign companies, people working for organisations in New Caledonia or French Polynesia, and associations that have only an RNA number. For those, it recommends a local login with email and password next to ProConnect.
Which steps lead to production?
The documentation gives seven steps:
- Learn the OpenID Connect basics.
- Define the user journey, using the documented recommendations.
- Create a test OIDC application and get a test
client_idandclient_secret. - Implement the authorization code flow.
- Contract with the DINUM through the DataPass form. The documentation says the DataPass comes back signed within 5 working days after completion, and that you can go on before it is approved.
- Request production credentials.
- Open the service.
Environments are separate. An integration client on the internet works neither in production nor on the state’s RIE network, and a change in one environment must be requested for each. Integration clients are self-service with no delay. Production clients are created by form, and the documentation promises client_id and client_secret within 5 working days after completion.
The DataPass asks you to name four roles: the data controller, the data protection officer, a technical lead, and the information security officer. The technical lead receives the technical access by email, and a mobile number is needed to send an access code. The documentation says the technical lead can be the technical contact of your supplier.
How does the OpenID Connect flow look in Next.js?
All calls go to https://PROCONNECT_DOMAIN/api/v2/, where the domain value depends on environment and network and is listed on a separate documentation page. The discovery document at /api/v2/.well-known/openid-configuration gives the four endpoints you need: authorization_endpoint, token_endpoint, userinfo_endpoint and end_session_endpoint.
The documented sequence maps to two Route Handlers.
Login start. On click, generate a random state and nonce of at least 32 characters each and keep them for the browser session. Redirect to /api/v2/authorize with response_type=code, your client_id, the exact redirect_uri, the scopes, state and nonce. The documentation warns that any extra parameter causes the error Y000400. It also says the redirect_uri must match the registered value exactly, including a trailing slash. Next.js redirects URLs with a trailing slash to the version without one by default, and trailingSlash: true reverses that, so the setting and the registered URI must agree.
// app/api/auth/login/route.ts
import { randomBytes } from 'node:crypto'
import { cookies } from 'next/headers'
import { NextResponse } from 'next/server'
const BASE = `https://${process.env.PROCONNECT_DOMAIN}/api/v2`
export async function GET() {
const state = randomBytes(32).toString('hex')
const nonce = randomBytes(32).toString('hex')
const store = await cookies()
const options = { httpOnly: true, secure: true, sameSite: 'lax' as const, path: '/', maxAge: 600 }
store.set('pc_state', state, options)
store.set('pc_nonce', nonce, options)
const url = new URL(`${BASE}/authorize`)
url.searchParams.set('response_type', 'code')
url.searchParams.set('client_id', process.env.PROCONNECT_CLIENT_ID!)
url.searchParams.set('redirect_uri', process.env.PROCONNECT_REDIRECT_URI!)
url.searchParams.set('scope', 'openid given_name usual_name email siret organization_label')
url.searchParams.set('state', state)
url.searchParams.set('nonce', nonce)
return NextResponse.redirect(url)
}Callback. ProConnect redirects the browser to your redirect_uri with code and state. The code expires after 60 seconds. Your server then does the back-channel work:
- Compare
statewith the stored value. - POST to
/api/v2/tokenasapplication/x-www-form-urlencoded, withgrant_type=authorization_code,client_id,client_secret,redirect_uriandcode. - Verify the
id_token, a JWT signed with the algorithm registered for your client (RS256, ES256 or HS256), and compare its nonce with the stored one. - Keep the
id_token, because logout needs it. - Call
/api/v2/userinfowith the access token as a Bearer header. The response is a signed JWT if you registered an algorithm, plain JSON if not.
// app/api/auth/callback/route.ts
import { cookies } from 'next/headers'
import type { NextRequest } from 'next/server'
const BASE = `https://${process.env.PROCONNECT_DOMAIN}/api/v2`
export async function GET(request: NextRequest) {
const params = request.nextUrl.searchParams
const store = await cookies()
if (params.get('state') !== store.get('pc_state')?.value) {
return new Response('Invalid state', { status: 400 })
}
const tokenResponse = await fetch(`${BASE}/token`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'authorization_code',
client_id: process.env.PROCONNECT_CLIENT_ID!,
client_secret: process.env.PROCONNECT_CLIENT_SECRET!,
redirect_uri: process.env.PROCONNECT_REDIRECT_URI!,
code: params.get('code') ?? '',
}),
})
if (!tokenResponse.ok) return new Response('Token exchange failed', { status: 502 })
const { access_token, id_token } = await tokenResponse.json()
// verify the id_token signature and its nonce against pc_nonce here
const userinfo = await fetch(`${BASE}/userinfo`, {
headers: { Authorization: `Bearer ${access_token}` },
})
// verify the userinfo JWT if you registered a signing algorithm, then
// run the access checks and create your own session
}The partner documentation’s token sample shows expires_in: 60, while its prose says the access token is valid for one hour. I would treat the integration environment as the authority and log what it returns.
Which claims arrive, and which identifier should I store?
Scopes decide which claims come back. The scope page lists openid, given_name, usual_name, email, uid, siret, idp_id, roles, organization_label, phone and custom. Authentication data such as amr, acr, sid, auth_time and iss appears only in the ID token.
The data page says what to key your users on. ProConnect sends a unique sub computed by itself, unique across all identity providers, and recommends it for identity reconciliation. The uid is passed through as the identity provider sent it and is unique only inside that provider. The page also lists data that varies by provider, such as organizational_unit, belonging_population and chorusdt, which are not authorised by default.
The documentation is not consistent on the roles scope. The scope page says services integrated since August 2024 have default access to all listed scopes, while the roles page says the field is not returned systematically and must be requested by email with the client_id and the intended use. Ask support during integration instead of assuming.
How do I restrict access to agents?
The documentation says ProConnect does not filter who can connect, and any professional with a valid account can use the button. The only exception is a private organisation, whose application can be limited to public agents. Everything else is your decision, made after the callback.
The restriction page lists filters partners use:
- the email domain
- the identity provider, through
idp_id - a list of known emails, for an internal back office
- the
rolesclaim, which holdsagent_public,agent_public_etatoragent_public_territorial, and is empty for anybody else - the
siretof the organisation, with a warning that for some populations the SIRET is not very reliable - data in the
customscope
It advises against siret_hint as access control, since the parameter only suggests an organisation at login. If you block on roles, the roles page requires the block screen to state the rule, the roles the user has, and the user’s SIRET and organisation name. A silent “error, please try again later” is explicitly discouraged.
Next.js has a position that fits. Its authentication guide says to keep the heavy checks close to the data, with a data access layer, and to use Proxy only for optimistic checks from the session cookie. It warns that layout checks do not re-run on every navigation. For a ProConnect app that means the allowed-agent decision is made once in the callback, stored as a minimal role value in your own session, and rechecked in the data access layer.
How should I handle my own session?
The ProConnect session lasts 12 hours. If your sessions are longer, the login button leads to the login screen again once ProConnect’s session has ended. If yours are shorter, a user who clicks the button before the ProConnect session ends is signed straight back in, and the max-age option in the OIDC specification is not yet implemented on ProConnect.
For your own cookie, the Next.js guide recommends HttpOnly, Secure, SameSite, Max-Age or Expires, and a Path, set on the server. It also says the payload should hold the minimum data, such as an ID and a role, and not personal data like an email address. So the session should carry the sub and a role, and personal fields stay on the server side or are fetched again when needed.
A refresh token lets you get user information after the access token expires: valid access token under one hour, refresh up to two hours after the token was issued, then a new login. The documentation says to keep the refresh token in the server-side session to avoid theft through XSS.
For logout, the documentation requires a redirect through the user’s browser to /api/v2/session/end with id_token_hint, a state and the registered post_logout_redirect_uri, so that the ProConnect and identity provider cookies are expired. A server-side request is not enough. On return, check the state and delete your own session data.
What about single sign-on and trust levels?
Single sign-on works by default. A silent login is optional: when the user arrives without a session on your side, redirect to /authorize with prompt=none. If ProConnect has a session, you get the usual callback. If not, the callback carries error=login_required, and your app decides what to show.
For stronger identity checks, the documentation describes acr values and the amr claim, which lists methods such as password, mail link, OTP, passkey and combined factors. A service can require an ACR level by sending a JSON claims parameter:
{
"id_token": {
"acr": {
"essential": true,
"values": ["https://proconnect.gouv.fr/assurance/consistency-checked-2fa"]
}
}
}Another documented value, https://proconnect.gouv.fr/assurance/certification-dirigeant, certifies a company officer. The documentation adds that an ACR level proves the reliability of an identity and does not filter a population.
How does a project run?
- You send the target organisations, the identity data you need and the current stack. On working days I answer by email inside 24 hours.
- I register an integration client, build the two Route Handlers and the session layer, and test with the identity provider the documentation provides for integration.
- I prepare the facts the DataPass asks for, such as the planned data and the roles to name, for you to enter and sign. You file it.
- After your written approval, I switch to the production client you requested and publish.
My wider Next.js work is on the Next.js developer page.
Describe your agent login to me
If your Marseille team or publisher builds a Next.js tool for public agents, send the target organisations, the data you need and the current login through the contact form. An initial quote, in writing, is free of charge. Filing the DataPass and choosing who may enter the application remain your decisions.
Selected projects
Examples of my work.
Website Delivery: Sole Practitioner Law Firm
Technical implementation for a sole practitioner law firm in Wroclaw: WordPress migration, SSL certificate, mail server configuration, and pre-launch QA.
WooCommerce wholesale API integration: an automotive parts store
Case study of integrating a WooCommerce store with an automotive wholesaler's REST API: catalog, stock and price synchronisation in real time plus automatic margin logic.
WPPoland - rebuilding a proof-led WordPress, Astro and technical SEO site
A method-led case study of the WPPoland rebuild: Astro, Markdown/MDX content, six locales, technical SEO, structured data, AEO/GEO and content quality gates.
WordPress support & development in Marseille
Need this service: Next.js developer in Marseille?
Describe your project by e-mail. I reply within 24 hours.
Describe your projectExplore other WordPress services and knowledge base
Migration to Astro, Next.js, and headless WordPress.
WooCommerce sync with ERP and wholesale systems.
Business process automation around WordPress and company systems.
Library of concrete automation use cases.
Headless WordPress, Sanity, Strapi, and Contentful with Astro or Next.js.
Astro, MDX, edge delivery, and Core Web Vitals measured on real traffic.
Custom WordPress engineering and architecture.
Scalable headless, ERP, and AI architecture for enterprise.
Related categories
Supporting articles

Six to sixteen weeks for typical engagements, with a four-phase shape: discovery, scoping, build and cutover, tuning. The variables are catalogue size, integration count, URL preservation, and editorial team readiness, not framework choice.

A definitive 4-year Total Cost of Ownership (TCO) analysis, real-world Core Web Vitals benchmarks, Astro 7 GraphQL APQ architecture, and a 10-point executive decision matrix for choosing between decoupled and traditional WordPress.

The Shopify Plus vs WooCommerce headless decision in 2026 is no longer a binary "platform vs custom" trade-off. Both can run headless, both integrate AI, both ship at the edge. The real axes are control, total cost over five years, and exit strategy. This article walks the matrix with confirmed platform facts.