Two-Factor Auth - WebToolkit issues

Hello Team,

I’ve been following the two-factor-auth example, and despite a seeming lack of documentation, I got most working by comparing the demo app’s build.gradle and settings.gradle files with those in my test app. However, there isn’t any mention of the additional web-toolkit module, and how to create it and add dependencies. It actually didn’t mention how to add the vaadin and authentication add-ons either, which is always disappointing. It would be great for the community if the steps to add these were included. Regardless…

I’m hitting an issue where the QR codes aren’t being generated, and an error replaces it. For lack of documentation, I’m not quite sure what I need to do. I receive the following error when click on the “Enable/Regenerate” button in the settings screen extension:

There’re just no directives regarding how to include this properly. I’m sorry if this is a base-level question, but I’m really trying to understand the process of setting this up properly, without having to manually edit the .gradle files.

I’m including what I’ve been able to create as a sample project. I’m really hoping someone can help me understand how to implement the dependencies and where to do so. I’m moreso hoping to get instructions of how to get the web-toolkit module functioning correctly.

twofactor.zip (102.1 KB)

I thank you very much in advance,
Adam

Hello Adam,

Thank you for your feedback. I’ve created an issue to improve the description of the example. About your problem, web-app.properties should contain the following property:

cuba.web.widgetSet = com.company.twofactor.web.toolkit.ui.AppWidgetSet

If you use the Studio, it must be generated automatically.

Thank you very much for the guidance, as well as opening the issue to improve the Readme. I’ve added the missing line in my web-app.properties file and the QR code is now displaying correctly.