@Override
    protected AuthenticationHandlerExecutionResult doAuthentication(final Credential credential, final Service service) throws Throwable {
        val otc = (OneTimePasswordCredential) credential;
        val token = passwordlessTokenRepository.findToken(otc.getId());
        if (token.isPresent()) {
            val passed = token
                .map(PasswordlessAuthenticationToken::getToken)
                .filter(StringUtils::isNotBlank)
                .stream()
                .allMatch(tk -> tk.equalsIgnoreCase(otc.getPassword()));
            if (passed) {
                val principal = principalFactory.createPrincipal(otc.getId());
                return createHandlerResult(credential, principal, new ArrayList<>());
            }
        }
        throw new FailedLoginException("Passwordless authentication has failed");
    }
This is {@link PasswordlessTokenAuthenticationHandler}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-passwordless-api/src/main/java/org/apereo/cas/authentication/PasswordlessTokenAuthenticationHandler.java