Class ExtensionConfigurationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.yubico.yubikit.fido.client.extensions.ExtensionConfigurationException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ExtensionNotSupportedException

public class ExtensionConfigurationException extends RuntimeException
Thrown by an Extension when a relying-party extension request cannot be processed and the WebAuthn ceremony must be aborted — for example an unsatisfiable request shape (largeBlob write with more than one allowed credential) or malformed extension input.

Unlike conditions that merely cause an extension to be ignored — which are signalled by returning null from the extension's processing methods — this is a hard failure. The client catches it and surfaces it as a ClientError carrying getCode(), with this exception preserved as the ClientError cause.

This is the common supertype for every extension hard failure, so a caller can test for "an extension request failed" with a single instanceof check. The one case that needs to be distinguished — the authenticator lacking a capability the relying party explicitly required — is the subtype ExtensionNotSupportedException; everything else (request-shape and malformed input, told apart by getCode(): ClientError.Code.CONFIGURATION_UNSUPPORTED ≙ NotSupportedError, ClientError.Code.BAD_REQUEST ≙ SyntaxError) carries its human-readable detail in the message.

It is unchecked so it can be raised from the extension processing lambdas (whose functional interfaces do not declare checked exceptions) without changing the Extension API.

See Also:
  • Constructor Details

    • ExtensionConfigurationException

      public ExtensionConfigurationException(String message)
    • ExtensionConfigurationException

      public ExtensionConfigurationException(ClientError.Code code, String message)
    • ExtensionConfigurationException

      public ExtensionConfigurationException(ClientError.Code code, String message, Throwable cause)
  • Method Details

    • getCode

      public ClientError.Code getCode()
      The ClientError.Code the client should report when aborting the ceremony.
    • getWebAuthnErrorName

      public String getWebAuthnErrorName()
      The WebAuthn DOMException name a client should reject the ceremony with for this failure: "SyntaxError" for ClientError.Code.BAD_REQUEST (malformed input), "NotSupportedError" otherwise (an unsatisfiable/unsupported request). Kept here, next to getCode(), so the Code-to-spec-name mapping lives in one place rather than being re-derived by each caller.