Class PhoneController

java.lang.Object
com.irurueta.authserver.authorization.api.web.ott.PhoneController
All Implemented Interfaces:
PhoneApi

@RestController public class PhoneController extends Object implements PhoneApi
Shows, enrols, verifies and removes the phone number of the authenticated account, the number the SMS codes go to. The paths, status codes and bodies are those of the contract apis/auth-server/rest-server/ auth-server-api-v1.yaml, through the generated PhoneApi; failures are answered by OttExceptionHandler. Starting an enrolment and verifying it spend SMS budget and guess a code, so both are limited per client address and per account (OttRateLimiter). Starting an enrolment (which may replace the verified phone, a second factor) and removing the phone need a recent multi-factor sign-in while the account has a confirmed second factor (StepUpGuard).
  • Field Details

    • ACCOUNT_KEY_PREFIX

      static final String ACCOUNT_KEY_PREFIX
      Prefix of the rate-limit key of an account, which cannot clash with a user name typed in a sign-in form.
      See Also:
    • currentAccountResolver

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

      private final FindUserPhoneUseCase findUserPhoneUseCase
      Finds the verified phone of the account.
    • startPhoneEnrolmentUseCase

      private final StartPhoneEnrolmentUseCase startPhoneEnrolmentUseCase
      Starts an enrolment.
    • confirmPhoneUseCase

      private final ConfirmPhoneUseCase confirmPhoneUseCase
      Confirms an enrolment.
    • removePhoneUseCase

      private final RemovePhoneUseCase removePhoneUseCase
      Removes the phone.
    • stepUpGuard

      private final StepUpGuard stepUpGuard
      Requires a recent multi-factor sign-in before the phone is replaced or removed.
    • rateLimiter

      private final OttRateLimiter rateLimiter
      Limits the requests.
    • phoneDtoMapper

      private final PhoneDtoMapper phoneDtoMapper
      Maps the results onto the contract's DTOs.
    • request

      private final jakarta.servlet.http.HttpServletRequest request
      The current request, injected as a thread-bound proxy, which tells the address of the client.
  • Constructor Details

    • PhoneController

      public PhoneController()
  • Method Details