java.lang.Object
com.irurueta.authserver.authorization.api.web.passkeys.PasskeyController
All Implemented Interfaces:
PasskeysApi

@RestController public class PasskeyController extends Object implements PasskeysApi
Manages the passkeys of the authenticated account (the operations of the contract). Registering one is not here: it is the WebAuthn ceremony of the security chain, which the account page drives.
  • Field Details

    • currentAccountResolver

      private final CurrentAccountResolver currentAccountResolver
      Resolves the account of the request.
    • listPasskeysUseCase

      private final ListPasskeysUseCase listPasskeysUseCase
      Lists the passkeys of an account.
    • renamePasskeyUseCase

      private final RenamePasskeyUseCase renamePasskeyUseCase
      Renames a passkey.
    • deletePasskeyUseCase

      private final DeletePasskeyUseCase deletePasskeyUseCase
      Deletes a passkey.
    • stepUpGuard

      private final StepUpGuard stepUpGuard
      Requires a recent multi-factor sign-in before a passkey is deleted.
    • passkeyDtoMapper

      private final PasskeyDtoMapper passkeyDtoMapper
      Maps the passkeys onto the contract's DTOs.
  • Constructor Details

    • PasskeyController

      public PasskeyController()
  • Method Details

    • listPasskeys

      public org.springframework.http.ResponseEntity<List<Passkey>> listPasskeys()
      Lists the passkeys of the authenticated account.
      Specified by:
      listPasskeys in interface PasskeysApi
      Returns:
      200 OK with the passkeys, possibly none.
    • renamePasskey

      public org.springframework.http.ResponseEntity<Passkey> renamePasskey(String id, RenamePasskeyRequest request)
      Renames a passkey of the authenticated account.
      Specified by:
      renamePasskey in interface PasskeysApi
      Parameters:
      id - credential identifier of the passkey.
      request - the new label.
      Returns:
      200 OK with the renamed passkey.
      Throws:
      PasskeyNotFoundException - if the account has no such passkey.
    • deletePasskey

      public org.springframework.http.ResponseEntity<Void> deletePasskey(String id)
      Deletes a passkey of the authenticated account.
      Specified by:
      deletePasskey in interface PasskeysApi
      Parameters:
      id - credential identifier of the passkey.
      Returns:
      204 No Content.
      Throws:
      PasskeyNotFoundException - if the account has no such passkey.
      InsufficientUserAuthenticationException - if the account has a confirmed second factor and the token does not show a recent multi-factor sign-in.