Class PasskeySecondFactorFragment

java.lang.Object
com.irurueta.authserver.authorization.api.web.passkeys.PasskeySecondFactorFragment
All Implemented Interfaces:
SecondFactorFragment

@Component public class PasskeySecondFactorFragment extends Object implements SecondFactorFragment
Contributes the "use a passkey" action to the second-factor page. The only data it needs is whether the signed-in user has a passkey at all: the options of the ceremony are asked from the framework endpoint, which, for a signed-in session, only allows the credentials of that user.
  • Field Details

    • ORDER

      public static final int ORDER
      Position of the passkey action in the second-factor page: after the TOTP forms.
      See Also:
    • AVAILABLE_ATTRIBUTE

      public static final String AVAILABLE_ATTRIBUTE
      Model attribute telling the fragment whether the user has a passkey to present.
      See Also:
    • userResolver

      private final SecondFactorUserResolver userResolver
      Resolves the identifier of the account of the signed-in user.
    • hasConfirmedPasskeyUseCase

      private final HasConfirmedPasskeyUseCase hasConfirmedPasskeyUseCase
      Tells whether the user has a registered passkey.
  • Constructor Details

    • PasskeySecondFactorFragment

      public PasskeySecondFactorFragment()
  • Method Details

    • templateName

      public String templateName()
      Gets the template that holds the fragment.
      Specified by:
      templateName in interface SecondFactorFragment
      Returns:
      passkeys-second-factor.
    • fragmentName

      public String fragmentName()
      Gets the fragment of the template.
      Specified by:
      fragmentName in interface SecondFactorFragment
      Returns:
      form.
    • order

      public int order()
      Gets the position of the fragment.
      Specified by:
      order in interface SecondFactorFragment
      Returns:
      ORDER.
    • modelAttributes

      public Map<String,Object> modelAttributes(org.springframework.security.core.Authentication authentication)
      Tells the template whether to offer the passkey.
      Specified by:
      modelAttributes in interface SecondFactorFragment
      Parameters:
      authentication - the authentication of the user the page is rendered for.
      Returns:
      the model attributes; none when nobody is signed in.