how to create a lock screen when the user do not use the app after a specif

I have the task to create a lock screen that pops up when the user don’t use the app after a specific duration, it asks the user to enter his username and password and prevent him to use the web app until he/she insert username/password.

I’m very new to vaadin.

Thanks in advance for any help.
Many thanks to detailed answers.