LumenForgee

Passkeys, short-lived signed tokens and sessionless access in B2B systems

Not everyone who needs access to a B2B system needs a full user account. A supplier uploads one document, an auditor views one report, a customer's employee approves one order. Creating an account with a password for each of them leaves abandoned credentials, forgotten passwords and a growing attack surface. This article covers three alternative access models and what they require in identification, tenant isolation, key rotation, performance and auditing.

Contents
  1. Three access models
  2. Anatomy of a short-lived signed token
  3. Passkeys in light access flows
  4. Strong identification and customer due diligence
  5. Tenant boundaries in tokens and the database
  6. Rotating signing keys without downtime
  7. A p99 latency budget at peak load
  8. Auditing, reconciliation and privacy
  9. Worked example: a document request in a supplier portal
  10. Common pitfalls
  11. FAQ
  12. Checklist
  13. Primary sources

Key facts

  • W3C published WebAuthn Level 3 as a W3C Recommendation on 25 August 2026; passkeys are built on this API.
  • A passkey's private key stays in the user's authenticator, and the credential is bound to the service's domain, which makes it phishing-resistant.
  • IETF RFC 9700 (January 2025) is the best current practice for OAuth 2.0 security, and RFC 8725 collects recommendations for safe use of JWTs.
  • In Finland, strong electronic identification is governed by Act 617/2009, and identification services are supervised by the Finnish Transport and Communications Agency Traficom.
  • The EU Anti-Money Laundering Regulation (EU) 2024/1624 applies from 10 July 2027 and harmonises customer due diligence requirements across member states.

Three access models

Access control in a B2B system is best designed around what the user must be able to do and how certain their identity must be. In practice there are three options.

Comparison of the three access models
PropertyFull user accountPasskey without a passwordResource-scoped signed token
What the server storesProfile, roles, credentialsPublic key and a random user handleIssuance and usage log only
LifetimeIndefiniteIndefinite, device-bound or syncedMinutes to hours
Typical useRegular usersRecurring but light usersOne-off task on one resource
Identity assuranceDepends on authenticationThe same person returns, but who is unknownHolder of the link; extra identification if needed

The models are not mutually exclusive. The same portal can use full accounts for its own users, passkeys for partners' contact persons and signed tokens for one-off tasks. What matters is defining separately for each model what it grants and when it expires.

Anatomy of a short-lived signed token

A resource-scoped token is a claim signed by the server: the holder of this token may perform this action on this resource until this moment. Access without an account through a short-lived signed token is safe only if the claim is narrow and the verification strict.

Example token payload (JWS, EdDSA)
{
  "iss": "https://portaali.example.fi",
  "aud": "document-api",
  "tnt": "tenant-4821",
  "res": "doc:7f3c9a",
  "act": "upload",
  "exp": 1795000000,
  "iat": 1794996400,
  "jti": "01JD2Q8V4M6X"
}
  • aud and res restrict the token to one service and one resource. A service rejects a token whose aud is not its own.
  • tnt binds the token to a tenant. The service compares it with the resource's owner and does not trust the token alone.
  • exp is kept short: minutes for an upload link, at most a few hours for a viewing link.
  • jti makes single use possible: a used identifier is stored and a second use is rejected.
  • The algorithm is pinned on the server. RFC 8725 advises against trusting the token's own alg field and to reject the none algorithm.

Tokens should not be passed as URL query parameters, because the query ends up in server logs, proxies and browser history. A better approach is to send a short code in the link that is exchanged for the actual token with a POST request, or to use the URL fragment, which the browser does not send to the server. The page also sets Referrer-Policy: no-referrer. If a token lives longer, it can be bound to the client's key with DPoP (RFC 9449), so a stolen token is not enough on its own.

Passkeys in light access flows

A passkey does not remove the account; it removes the password. The server stores a public key and a user handle, but the handle does not have to be a name or an email address. Discoverable credentials allow sign-in without a username: the browser offers the user the service's credentials and the server recognises the user from the signature.

This suits a partner's contact person who returns once a month. Nothing needs to be stored about them beyond a random handle, the tenant and the permissions. Data minimisation is a principle in Article 5 of the GDPR, and this structure implements it directly.

  1. The first visit uses a single-use invitation token that only allows registering a passkey.
  2. At registration the server creates a random user handle and links it to the invitation's tenant and role.
  3. Later sign-ins use the passkey; the invitation token has already been used and does not work again.
  4. If the device is lost, a new invitation is issued through the tenant's administrator. The recovery path is always the attacker's easiest route, so it must not be weaker than the sign-in itself.

Strong identification and customer due diligence

A passkey proves that the same authenticator returns, not who the user is. When identity must be verified, for example for approving a contract or for statutory customer due diligence, strong electronic identification is needed. In Finland this is typically done with online banking credentials, a mobile certificate or an identity card through an identification broker service, and the service receives the result through an OpenID Connect interface.

Act 617/2009 governs strong electronic identification and trust services, and identification service providers form a trust network supervised by Traficom. Architecturally, this means strong identification is a separate, infrequent event whose result is bound to the user or to a single action. It is not performed on every request.

If the service provider is an obliged entity under the Finnish Anti-Money Laundering Act (444/2017), customer due diligence requirements apply regardless of the access model. Strong electronic identification can be used for remote identification. Regulation (EU) 2024/1624 harmonises the requirements across the EU from 10 July 2027, so the data model for identification results is worth designing now so that it provides evidence of how and when a customer was identified. Personal identity codes are not stored in tokens or logs, only in the system that must process them.

Tenant boundaries in tokens and the database

In a multi-tenant system, a signed token is one layer of tenant isolation, not the only one. The service must check that the token's tenant and the resource's owner are the same before it reads or writes anything.

  • Tenant context is set from the token at the start of the request and passed to the database, for example as a session variable for PostgreSQL row-level security.
  • Per-tenant signing keys limit the damage if one key leaks, but increase the number of keys and the rotation work. A shared key with a strict tnt check is enough for most systems.
  • Resource identifiers are random so they cannot be guessed, but verification never relies on unguessability alone.
  • Deleting a tenant invalidates its valid tokens, because verification is always done against ownership data in the database.

Rotating signing keys without downtime

Token signing keys must be rotated regularly and immediately if a leak is suspected. Downtime occurs if a verifier does not yet know the new key, or if the old one is removed while tokens signed with it are still valid. The solution is an overlap window.

  1. Create a new key pair in a key management service or HSM; the private key never leaves it.
  2. Publish the new public key in the JWKS set with its own kid, but do not sign with it yet.
  3. Wait at least the verifiers' JWKS cache lifetime so that all of them know the new key.
  4. Switch signing to the new key.
  5. Keep the old public key in the JWKS for the lifetime of the longest token, then remove it.

When tokens live for minutes, the whole rotation takes under an hour and can be automated. In a leak, steps 2–4 are done immediately and the old key is removed without waiting: some valid tokens are rejected, which is the point.

A p99 latency budget at peak load

Sessionless verification is fast because the signature can be checked locally without a network call. At peak load, problems usually come from elsewhere: a JWKS fetch with a cold cache, a single-use check against the database, or a token introspection call (RFC 7662) on every request.

Example latency budget for access verification (design targets, not measurements)
StepPlanned p99 budgetNote
Signature verification (EdDSA, local)under 1 msJWKS cached, refreshed in the background
Tenant and resource check2–5 msIndexed lookup or cache
Single-use check (jti)1–3 msAtomic set in a key-value store, TTL = token exp
Introspection to the identity serviceavoidedOnly for long-lived or immediately revocable tokens

The budget is measured, not assumed. With OpenTelemetry, each verification step gets its own span, and a histogram metric gives the p99 per step. jti, user or resource identifiers are not put in metric attributes, because they explode cardinality; the tenant can be an attribute if the number of tenants is reasonable. JWKS cache expiry gets its own alert, because it is the most common cause of a sudden p99 spike.

Auditing, reconciliation and privacy

When access does not go through an account, the audit log is the only place that shows who did what. For each token, the issuance is recorded (who issued it, for which resource and tenant, validity period), and each use is recorded as an event with the same jti.

  • Issuance and usage logs are reconciled regularly: use without issuance is a serious anomaly, and a large number of unused issuances indicates distribution that is too broad.
  • The log is written append-only to a separate store where the application has no delete permission.
  • Logs use pseudonymous identifiers. Under the GDPR these are still personal data, so the retention period is defined and justified.

Information stored in the browser is assessed under section 205 of the Finnish Act on Electronic Communications Services, which implements Article 5(3) of the ePrivacy Directive. A session or authentication cookie that is strictly necessary for the service does not require consent; analytics and tracking do.

Worked example: a document request in a supplier portal

A manufacturing company's procurement portal requests an annual sustainability report from a supplier. The supplier's contact person has no account in the portal, and creating one for a single document is not wanted.

  1. The buyer creates the request in the portal. The service creates the resource doc:7f3c9a for tenant tenant-4821 and records the issuance in the audit log.
  2. The supplier receives an email with a short single-use code in the link fragment. The code is valid for 72 hours.
  3. When the supplier opens the link, the browser exchanges the code with a POST request for a 15-minute upload token with act upload and res doc:7f3c9a.
  4. The document API verifies the signature locally, compares the tenant with the resource's owner and marks the jti as used.
  5. If the contract requires the signatory's identity to be verified, the upload additionally requires strong electronic identification, and a reference to the identification event is stored in the document's metadata.
  6. A nightly reconciliation run compares issuances and uses and reports expired, unused requests to the buyer.

No permanent account, password or profile was created for the supplier. The system retained only the document, the issuance and usage log and, where needed, a reference to strong identification.

Common pitfalls

  • Token in a URL query parameter, from where it ends up in logs, proxies and the Referer header.
  • Accepting the token's own alg field as is, letting an attacker switch the algorithm.
  • Tenant check done only from the token and not from the resource's actual owner.
  • Removing an old signing key from the JWKS before tokens signed with it have expired.
  • Every request calls the introspection endpoint, and the identity service becomes the p99 bottleneck.
  • A passkey recovery path via email link that is weaker than the passkey itself.
  • Copying a personal identity code or another strong identification attribute into tokens or logs.

FAQ

Is a passkey an account-free sign-in method?

Not entirely. A passkey removes the password, but the server stores a public key and a user handle. The handle can be random, though, and does not need to be linked to a name or email address.

How short should a token's lifetime be?

As short as the task allows: minutes for a single action and at most a few hours for viewing rights. A longer invitation link is best implemented as a single-use code that is exchanged for a short-lived token.

When is strong electronic identification needed?

When identity must be verified, for example for approving contracts or for statutory customer due diligence. For simply uploading a document, a resource-scoped token is usually enough.

Should every tenant have its own signing key?

It limits the impact of a leak but increases the number of keys to manage. In most systems a shared key with a strict tenant check against the resource owner is sufficient and easier to maintain.

How do I revoke a token before it expires?

Single-use tokens are revoked on use. Others need a denylist by jti or introspection. A short lifetime keeps the denylist small.

Checklist

  • Each access model has a definition of what it grants and when it expires.
  • Tokens contain aud, tenant, resource, action, exp and jti claims.
  • The algorithm is pinned on the server and the none algorithm is rejected.
  • Tokens are not passed in URL query parameters, and Referrer-Policy is set.
  • The tenant check is made against the resource owner, and the database has a second protection layer.
  • Key rotation is automated with an overlap window and rehearsed for a leak.
  • The p99 of verification steps is measured with OpenTelemetry without high-cardinality attributes.
  • Issuance and usage logs are append-only and reconciled regularly.
  • The result of strong identification is stored as a reference; personal identity codes are not copied into tokens or logs.

Primary sources

  1. W3C – Web Authentication: An API for accessing Public Key Credentials Level 3
  2. IETF – RFC 9700: Best Current Practice for OAuth 2.0 Security
  3. IETF – RFC 8725: JSON Web Token Best Current Practices
  4. IETF – RFC 9449: OAuth 2.0 Demonstrating Proof of Possession (DPoP)
  5. IETF – RFC 7662: OAuth 2.0 Token Introspection
  6. IETF – RFC 7517: JSON Web Key (JWK)
  7. Traficom – Notifications of electronic identification and trust services (guideline 214/2023 O, in Finnish)
  8. Traficom – Cookie guidance for service providers (in Finnish)
  9. EUR-Lex – Regulation (EU) 2016/679 (General Data Protection Regulation)
  10. EUR-Lex – Directive 2002/58/EC (ePrivacy Directive)
  11. EUR-Lex – Regulation (EU) 2024/1624 (Anti-Money Laundering Regulation)
  12. EUR-Lex – Delegated Regulation (EU) 2018/389 (strong customer authentication)
  13. OpenTelemetry – Semantic Conventions

Related research