Next.js developer in Malmö

Next.js for businesses in Malmö, 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.

My WordPress.org profile

An organisation that wants to identify people in Sweden does not usually integrate every e-ID issuer one by one. It connects to a federation, and in Sweden that is Sweden Connect. Mariusz Szatkowski here, writing from Gdynia. I work remotely and in writing, and the Next.js login code is the part I build. Whether your organisation may connect, and at which assurance level, is decided in your agreement with Digg.

Malmö town hall on the Stortorget square

Malmö town hall on Stortorget, photographed by Liberaler Humanist and published under CC BY-SA 3.0 on Wikimedia Commons.

#What is Sweden Connect?

Sweden Connect is an identity federation operated by the Swedish Agency for Digital Government, Digg. The Sweden Connect technical framework sets the technical requirements and is based on SAML 2.0 and OpenID Connect. Digg describes it as covering user authentication, electronic signature services, identifiers and the rules for joining the federation. The latest official version is dated October 2026.

Relying parties, the apps that need to know who the user is, integrate with identity providers through standard messages. The framework says most relying parties use a stand-alone authentication server, so the adaptation for Sweden Connect is usually limited to the authentication solution.

#Who can connect to Sweden Connect?

The Sweden Connect page on connecting describes five steps: define your needs and choose a connection method, apply if your organisation is not yet in the federation, sign the agreement after approval, register the e-service with SAML or OpenID Connect, and keep metadata current.

What the pages say about eligibility:

  • Digg’s application page says organisations and companies apply there, with an organisation number, a business contact who holds the agreement and an authorised connection contact who manages technical contacts.
  • The main agreement is titled “Anslutningsavtal för Sweden Connect, offentlig aktör”, an agreement for public actors.
  • Digg states that public actors can offer login with several e-IDs without procurement through the authorisation system for electronic identification, which needs a further agreement on top of the Sweden Connect one.
  • For foreign e-IDs through eIDAS, the Sweden Connect agreement and the application form are enough.

I read no page that settles whether a private company can join on its own. Digg lists e-legitimation@digg.se for non-technical questions and operations@swedenconnect.se for technical ones. Ask before you plan.

The preparation page also notes that direct connection suits larger organisations with their own identity and integration skills, such as agencies and regions, while smaller organisations often connect through an existing supplier or integrator. That decides how much of the integration lands on a Next.js developer in the first place.

#Which protocol fits a Next.js app?

The framework lists a SAML deployment profile (version 1.9 in the October 2026 documents) and an OpenID Connect profile for Sweden Connect (version 1.1). The OpenID Connect profile builds on the Swedish OpenID Connect profile published by OIDC Sweden, which profiles OpenID Connect Core.

For a Next.js app running on Node.js I would take OpenID Connect, because the flow is plain HTTPS requests and JSON Web Tokens. That is a build decision, not a rule. An organisation whose existing login runs on SAML keeps SAML.

#Which assurance levels does Sweden Connect use?

The framework introduction explains that the level of security at login rests on the assurance level the relying party requires. Four levels, 1 to 4, are defined in the Swedish eID Assurance Framework. The EU regulation eIDAS defines three, low, substantial and high. An issuer of identity assertions has to prove that its process meets the requirements of a given level, which covers the creation of the assertion, authentication, the issuing process, the eID and its issuer, and how the applicant’s identity was established. Sweden has notified Swedish eIDs at the levels substantial and high.

In the OpenID Connect federation, Digg assigns trust marks to providers according to the level for which they are approved: loa2, loa3 and loa4, plus marks for acting as an eIDAS connector and for non-resident identities. A relying party may check that the provider holds the trust mark matching the acr value in the ID token. Your requirement decides what you request. A login for reading a public service log and a login for signing a contract do not need the same level, and the agreement or the data you handle sets the floor.

#How do you join the OpenID Connect federation?

The Sweden Connect OpenID Federation Rules, published in October 2026, describe how an entity joins.

RouteWhat happens
Relying party with its own Entity ConfigurationThe party publishes a signed configuration with the federation’s registration intermediate in authority_hints. An administrator logs in to the portal and enters the Entity Identifier. Keys and metadata are checked, the operator authorises Trust Marks and a Subordinate Statement is issued.
Hosted relying partyThe administrator supplies metadata in the portal with the domain. The operator checks domain ownership, checks metadata and signs the Entity Configuration for the relying party.
Limited OpenID Federation supportA relying party whose software lacks the support can be hosted. Static metadata configuration is possible but informal and at the party’s own responsibility.

The organisational affinity policy means Digg asserts that the organisation name is the legal name of the owner, that the organisation identifier holds its registration number, that the registering administrator is verified as authorised to represent it, and that the display names were checked. A relying party is not audited before it joins, unlike a provider.

Most Next.js OpenID Connect libraries speak plain OpenID Connect, not OpenID Federation. The hosted route exists for exactly that gap.

#What does the Next.js code have to do?

The Swedish OpenID Connect profile fixes the request shape.

  • Authentication requests use the authorization code flow.
  • scope contains openid, and the redirect_uri must match the registered value by direct string comparison.
  • Regular relying parties should use PKCE, with S256 as the challenge method. A browser-only app or a native app must.
  • The token endpoint must support private_key_jwt, and a relying party should default to it, with a new assertion JWT for each call.
  • The ID token is validated according to section 3.1.3.7 of OpenID Connect Core.
  • Userinfo responses are signed, and a relying party must be ready to receive partial data, because a provider releases claims on a best effort basis.
  • prompt set to login forces a fresh authentication, and prompt set to none corresponds to the SAML IsPassive setting.

A Route Handler that starts the flow with PKCE:

// app/auth/se/start/route.ts (sketch, not production code)
import { createHash, randomBytes } from 'node:crypto'
import { cookies } from 'next/headers'
import { redirect } from 'next/navigation'

export async function GET() {
  const verifier = randomBytes(32).toString('base64url')
  const challenge = createHash('sha256').update(verifier).digest('base64url')
  const state = randomBytes(32).toString('base64url')
  const nonce = randomBytes(32).toString('base64url')

  const jar = await cookies()
  jar.set('se_tx', JSON.stringify({ verifier, state, nonce }), {
    httpOnly: true,
    secure: true,
    sameSite: 'lax',
    maxAge: 600,
    path: '/auth/se',
  })

  const url = new URL(process.env.SE_AUTHORIZE_URL!)
  url.search = new URLSearchParams({
    response_type: 'code',
    client_id: process.env.SE_CLIENT_ID!,
    redirect_uri: process.env.SE_REDIRECT_URI!,
    scope: 'openid',
    state,
    nonce,
    code_challenge: challenge,
    code_challenge_method: 'S256',
    acr_values: process.env.SE_ACR!, // the value your agreement and the profile name
  }).toString()

  redirect(url.toString())
}

Next.js documents that cookies can be set in Route Handlers but not while a Server Component renders, which is why the flow starts in a handler. The callback handler checks state, exchanges the code with the verifier and a signed client assertion, validates the ID token including nonce and acr, and creates the app session.

#What about the personal identity number?

The profile says a provider must not release any claim it has not been authorised to release, and that how this authorisation works is outside the profile. Whether your organisation may receive a personal identity number comes from your agreement and the legal basis you rely on. That is a question for your data protection adviser and for Digg. I build the claim handling, and I do not decide whether you are entitled to the value.

#Checklist for a Next.js app on Sweden Connect

  • Ask Digg whether your organisation can connect, and under which agreement.
  • Decide direct connection or connection through a supplier.
  • Pick SAML or OpenID Connect, and the assurance level the use case needs.
  • Generate keys and choose hosted or own Entity Configuration.
  • Use PKCE, state, nonce and exact redirect URIs, and keep the signing key on the server.
  • Validate the ID token and check the acr value against what you requested.
  • Handle partial claims without breaking the login.
  • Keep metadata updated and follow Sweden Connect incident information.

#How does a project run?

  1. You send what the app is for, the e-IDs and level you need, and where the agreement with Digg stands.
  2. I write down the scope and my assumptions, with the questions only Digg can answer.
  3. I build the Next.js login against the test environment Digg gives you, and you check it with a test identity.
  4. After written acceptance, the registration moves to production through your authorised administrator, not through me.

Access to the repository and the hosting account is all I need from your side. Other Next.js work is listed on the Next.js developer page.

#Planning Swedish e-ID login in Malmö

If your Malmö organisation needs e-ID login in a Next.js app, use the contact form and name the users, the assurance level you expect and the stage of your Digg application. The first written estimate for the Next.js build is free, and I will mark which answers have to come from Digg.

WordPress support & development in Malmö

See also in Sweden

Need this service: Next.js developer in Malmö?

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

Describe your project

Explore other WordPress services and knowledge base