Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class WebAuthnRegistrationFilter

  1. Object
  2. WebAuthnRegistrationFilter

ImplementsSecurityFilter

Lets a signed-in user register a passkey, and remove one of theirs:

  • POST /webauthn/register/options answers the options to make one with;
  • POST /webauthn/register takes the authenticator’s answer and stores the credential;
  • DELETE /webauthn/register/{credentialId} removes a credential, the id in base64url.

All three are for a user who signed in during this session. Somebody a remember-me cookie brought back is sent to sign in first: a stolen cookie must not be able to leave a passkey of the thief’s behind. The filter runs after the chain’s authorization rules, which say who may reach it at all.

The options are kept in the session, for five minutes unless set otherwise, and taken out of it before the answer is looked at.

Fields

public static final String PENDING = "CN1_WEBAUTHN_REGISTRATION"The session attribute a registration’s options wait under.

Methods

public HttpServer.Response doFilter(HttpServer.Request request, FilterChain chain) throws ExceptionThe answer to request; null when nothing under the chain routes it, which the server answers 404.

Inherited methods

Field details

PENDING

public static final String PENDING = "CN1_WEBAUTHN_REGISTRATION"
The session attribute a registration’s options wait under.

Method details

doFilter

public HttpServer.Response doFilter(HttpServer.Request request, FilterChain chain) throws Exception
The answer to request; null when nothing under the chain routes it, which the server answers 404.

Throws

Exception