Interface SecondFactorFragment

All Known Implementing Classes:
OttSecondFactorFragment, PasskeySecondFactorFragment, TotpSecondFactorFragment

public interface SecondFactorFragment
Extension point that lets a second factor contribute a Thymeleaf fragment to the second-factor page. The page template renders one fragment per bean, sorted by order(), in the same way the login page renders the LoginMethodFragment beans. A fragment that depends on the signed-in user (an enrolment form, a warning) contributes its data through modelAttributes(Authentication).
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the name of the fragment inside the template.
    default Map<String,Object>
    modelAttributes(org.springframework.security.core.Authentication authentication)
    Gets the model attributes the fragment needs for the signed-in user, added to the model of the page.
    int
    Gets the position of the fragment in the page; lower values are rendered first.
    default String
    Gets the Thymeleaf fragment expression, such as template :: fragment.
    Gets the name of the template that holds the fragment.
  • Method Details

    • templateName

      String templateName()
      Gets the name of the template that holds the fragment.
      Returns:
      the template name.
    • fragmentName

      String fragmentName()
      Gets the name of the fragment inside the template.
      Returns:
      the fragment name.
    • order

      int order()
      Gets the position of the fragment in the page; lower values are rendered first.
      Returns:
      the order.
    • reference

      default String reference()
      Gets the Thymeleaf fragment expression, such as template :: fragment.
      Returns:
      the fragment expression.
    • modelAttributes

      default Map<String,Object> modelAttributes(org.springframework.security.core.Authentication authentication)
      Gets the model attributes the fragment needs for the signed-in user, added to the model of the page. Their names should start with the factor's own prefix (for example totp), since every fragment shares the model.
      Parameters:
      authentication - the authentication of the user the page is rendered for.
      Returns:
      the attributes; none by default.