java.lang.Object
com.irurueta.authserver.authorization.application.totp.RecoveryCodes

@Component public class RecoveryCodes extends Object
Creates recovery codes (Crockford base-32 alphabet, so no I, L, O or U) and normalizes what a user types back into that form.
  • Field Details

  • Constructor Details

    • RecoveryCodes

      public RecoveryCodes()
  • Method Details

    • newCode

      public String newCode()
      Creates a new random code.
      Returns:
      the code, CODE_LENGTH characters long.
    • normalize

      public String normalize(String typed)
      Normalizes a typed code: upper case, without separators, and with the look-alike letters Crockford maps (O to 0, I and L to 1).
      Parameters:
      typed - the code as typed.
      Returns:
      the canonical form.