Two Factor Authentication

Is there a way to implement a two factor authentication because in your documentation there’s nothing?

You can use any framework you want to do so. Vaadin does not forbid it.

This doesn’t answear my question

It does. Vaadin is not a security framework. Use any framework like spring security, key cloak or other security provider to implement your requirement.

@poised-leopard, clean your example(s) and push them to GitHub. Pretty please :pray:

Yeah, I should really try to so that, even if it might not be exactly what @benevolent-yaffle is looking for.

…so maybe some clarifying questions: What are you using right now for auth (spring security, keycloak, …)? Are you looking for a specific type of 2FA/MFA (OTP, Webauthn/hardware, …)?

I’m using spring security and looking for something like that

https://medium.com/javarevisited/spring-boot-two-factor-authentication-78e00aa10176

image.jpg

I have this view page and I want to import js and css and instead this email text field i want to have the qr image

which is generated by :

QrData data = new QrData.Builder()
.label(“Two-factor-auth-test”)
.secret(secret)
.issuer(“exampleTwoFactor”)
.algorithm(HashingAlgorithm.SHA1)
.digits(6)
.period(30)
.build();

    byte[] imageData = new byte[0];

    try {
        imageData = qrGenerator.generate(data);
    } catch (QrGenerationException e) {
        log.error("unable to generate QrCode");
    }

    String mimeType = qrGenerator.getImageMimeType();

    return getDataUriForImage(imageData, mimeType);

which returns: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAAFeAQAAAADlUEq3AAADC0lEQVR4Xu2ZvXXjQAyE4edA4ZXAUlgaWZpKYQkOFegJhxlAEqilbF98g8AUd79VMMbvyvz3drXXlW9McDfB3QR3E9zt/4BvRouXP9u82uclHv7heKzx4Oan4EMYn3zlGcDumy1+PX3F2y2O3hHBB/AFlDvW8bDpbHjY7FTdTPC38M1O7kGFwFOqPp0XeqrgH+CnUwZnRb3TWXDB8YfKMhVeT3jNb/D020QEjzB0hZYXwMODm4IP4Z1FAfav3I4g35ngbk+dow4zMS4f0dCkw4bFW6RJ5EfBR3BmRMfClmc2JEY0NEiMCHLB7+HJ1+r+qopUJxM1+uGpggc4W5glPmGdOfC8VHRD5xd/Fty9zhDdd6fE0WijYzGoG89wT/AIlxsGlk1LKhsNzcbRg57aarfgJ4xGLwVG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