Next.js developer in Helsinki

Next.js for businesses in Helsinki, delivered remotely by one developer.

Next.js developer

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: WordPress Helsinki

My WordPress.org profile

A Next.js service that offers Finnish strong identification does not talk to banks one by one. It connects to Suomi.fi e-Identification, the joint identification service run for public administration. I write the Next.js side of such a connection, from Gdynia, with the Helsinki team over email and shared documents. The decisions about the licence and the data belong to your organisation.

Oodi library, Helsinki

Oodi central library in Helsinki. Image by ArildV, CC BY-SA 4.0, Wikimedia Commons.

#Who can join Suomi.fi e-Identification?

The Suomi.fi for Service Developers site describes the service as a joint identification service for public administration. Customer organisations use it to identify end users in their own digital services.

The service description sets the commercial frame:

  • Public administration organisations join and use it free of charge.
  • Organisations outside public administration, and companies not owned by a public sector entity, pay a fee.
  • Use is limited to identifying users of e-services. It must not be used for authentication inside an organisation.

So a staff login for your own intranet is not what this is for. A citizen portal, a customer area for a service with a public task or a booking system that needs a verified identity is. Whether your organisation qualifies, and at what price, is a question for the Digital and Population Data Services Agency. The service pages list organisaatiopalvelut@dvv.fi as the contact for customer organisations.

#Which sign-in methods and assurance levels exist?

The service description lists online banking codes, mobile ID, hightrust.id, electronic ID cards, healthcare smart cards and organisation cards, and foreign eIDAS identification tokens. The Finnish Authenticator is a separate item: it carries a fee, users must accept separate terms, and it is not included by default.

Assurance levels matter for what the e-service accepts:

MethodLevel named on the page
Electronic ID card, healthcare smart cards, organisation cardshigh
Online banking codes, hightrust.id, mobile IDsubstantial
Finnish Authenticatorno defined level

Each e-service chooses the level it accepts, and accepting substantial also requires accepting high. In a Next.js app this becomes one configuration value that you pass in the identification request, not a rule scattered across pages.

Users who sign in with a foreign eIDAS token are different. They get a PersonIdentifier whose structure varies by country. Their Finnish personal identity code is not returned, unless identity linking succeeds, and population register data is not available for them. A form that assumes a Finnish personal identity code for every user breaks for these users.

#SAML or OIDC for a new service?

Both exist, and the direction is clear. The Suomi.fi notice of 3 December 2026 says:

  • The OIDC interface was published to the test environment on 3 December 2026.
  • It is to be released to production on 28 January 2027, and production OIDC metadata deliveries start then.
  • E-services must move to OIDC by 1 June 2028. The SAML interface is supported until then and discontinued on that date.
  • Metadata installations run weekly on Wednesdays, and each e-service schedules its own transition.

The notice lists the activation order for a service moving over: register the OIDC environment for testing, implement and test, register it for production, activate it, then request deletion of the old SAML environments.

For a new Next.js build the sensible choice is OIDC from the first commit, because a SAML integration would need a second project before mid-2028. A service that already runs on SAML keeps working and gets a planned migration. The SAML setup guide on the same site covers the older path, with the production IdP metadata and a certificate that changes about every two years.

#What does the access licence involve?

The application page describes the order of work. An organisation registers in Suomi.fi Service Management, or asks for an invitation to its existing account. Then the application is submitted with eight points: organisation details, contact details, invoicing details if the service is chargeable, the data being sought, the client service details, the data protection statement, agreement to the terms and sending.

Two details save time:

  • Metadata is not attached to the application. It is uploaded in the e-Identification management interface after the licence is granted.
  • The page gives no processing time and asks you to apply well in advance of the planned production start.

The test environment is available without an access licence. That means the Next.js integration can be built and tested while the paperwork runs. The SAML guide adds the conditions for production metadata: all test cases complete, an access licence and accepted terms of use.

#How does the OIDC flow work?

The technical description says the interface is based on OIDC Core, without all optional sections. Identification uses the authorization code flow:

  1. The e-service sends a signed identification request, and the browser is redirected to Suomi.fi e-Identification.
  2. After login the browser returns to a registered redirect address with an authorization code.
  3. The e-service exchanges the code for tokens in a server to server call.

The token request details from the technical pages:

  • It is an HTTP POST with form encoding, and the grant type is authorization_code.
  • Client authentication uses private_key_jwt, which replaces a client secret. The assertion header carries kid and alg, and the listed algorithms are RS256, RS512, ES256, PS256 and PS512.
  • The response holds an ID token that is encrypted and signed. The outer encryption uses RSA-OAEP-256 with A256GCM, and the nested token is signed with RS256.
  • The access token is not in use.
  • Redirects go only to addresses registered in advance in the metadata. Metadata registered in Service Management is a precondition for deploying the interface, and all fields are mandatory.

The page lists the checks to run on the ID token: decrypt first, verify the signature against the published key set, compare iss, compare aud with your client ID, check exp and compare the nonce with the one you sent.

#Which scopes need a data permit?

The scopes page ties each scope to an access licence level:

ScopeLevel
openid, nameslimited
domesticaddress, municipality, foreignaddress, protectionorder, mailmedium
finnishcitizenshipextensive

Limited scopes come with the licence by default. Medium and extensive scopes must be permitted separately in the e-service metadata, and a scope that is requested without that permission is removed from the token response. In the application you specify the data you seek, so ask only for what the service uses.

#How does it fit into the Next.js App Router?

Route Handlers live in a route.ts file inside the app directory and support GET, POST and the other HTTP methods, according to the Next.js docs. They are not cached by default. That suits the two endpoints this flow needs: one that starts the identification and one that receives the code.

The Next.js docs state that environment variables without the NEXT_PUBLIC_ prefix are available only in the Node.js environment. The private signing key and the decryption key belong there, never in a client bundle. The cookies() function reads cookies in Server Components, while setting them has to happen in a Route Handler or Server Function, because HTTP does not allow cookies after streaming has started.

A skeleton of the callback, with the cryptographic helpers left as placeholders for a JOSE library:

// app/api/auth/callback/route.ts
import { cookies } from "next/headers";

export async function GET(request: Request) {
  const url = new URL(request.url);
  const code = url.searchParams.get("code");
  const store = await cookies();
  const nonce = store.get("oidc_nonce")?.value;
  if (!code || !nonce) return new Response("Bad request", { status: 400 });

  // discovery document: test and production URLs differ
  const config = await fetch(process.env.OIDC_DISCOVERY_URL!, {
    next: { revalidate: 3600 },
  }).then((r) => r.json());

  // back-channel POST, never from the browser
  const body = new URLSearchParams({
    grant_type: "authorization_code",
    code,
    redirect_uri: process.env.OIDC_REDIRECT_URI!,
    client_assertion_type:
      "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
    client_assertion: await signClientAssertion(config.token_endpoint),
  });
  const res = await fetch(config.token_endpoint, { method: "POST", body });
  const { id_token } = await res.json();

  // decrypt first, then verify signature, iss, aud, exp, nonce
  const claims = await decryptAndVerifyIdToken(id_token, nonce);

  store.set("session", await createSession(claims), {
    httpOnly: true,
    secure: true,
    sameSite: "lax",
    path: "/",
  });
  store.delete("oidc_nonce");
  return Response.redirect(new URL("/", request.url));
}

The discovery URLs for the test and the production environment are printed on the token request page, and the key sets sit next to them. Which endpoint is the token endpoint comes from that metadata, not from a constant in your code.

#How does logout work?

The technical description gives two paths. When the e-service starts logout, the browser goes to the end-session endpoint and returns to a registered post-logout address. When another service starts single logout, Suomi.fi calls the frontchannel_logout_uri from your metadata, in a hidden iframe. frontchannel_logout_session_required decides whether the session ID is included.

In Next.js that second address is another Route Handler that deletes your own session cookie. It has to answer even when the user has no open tab in your service, so it must not depend on client state.

#How does a Suomi.fi login project run?

  1. You send the service address, which user groups sign in, the data you need after login and the date you would like to go live.
  2. I write down the assurance level, the scopes and the sessions model, and name what depends on the licence.
  3. I build against the test environment on a staging deployment, so nothing waits for the paperwork.
  4. The production metadata goes through Service Management after your organisation has the licence. I switch the environment variables only after you approve the staging result in writing.

I need the redirect addresses, the person who holds the Service Management account and a decision on who stores the keys. Other App Router work, from dashboards to CMS builds, is described on the Next.js developer page.

#Planning a Suomi.fi login

If your Helsinki service needs Finnish strong identification, send the scope through the contact form: which user groups sign in, which scopes you need and whether a SAML connection already exists. A written estimate for the OIDC build against the test environment costs nothing. Whether your organisation qualifies for the service and at what cost is for you and the Digital and Population Data Services Agency to settle.

Need this service: Next.js developer in Helsinki?

Describe your project by e-mail. I reply within 24 hours.

Describe your project

Explore other WordPress services and knowledge base