Docs

Documentation versions (currently viewingVaadin 25.4 (pre-release))

Impersonate Users

In an application with a login, sign in as any of its users by name, without a password, and switch between them.

In an application with a login, see it as any of its users: switch to a user by name, without a password. It’s good for checking what each role may see and do, such as which views are in the menu.

Sign in as a user, then switch to an admin
  1. On the login page, open the ⋮ menu at the end of the toolbar and choose Impersonate App User. Type a username in the panel.

  2. Click Switch User. The page reloads with you signed in as that user, without a password: the menu lists the views that a user may open.

  3. Open the panel again: it lists the usernames you’ve used. Switch to an administrator, and the menu has the views for administrators too.

What It Needs

Impersonation works in applications that use Spring Security, as set up in Add Login. Copilot looks the username up with your application’s UserDetailsService, and signs you in with that user’s roles. Without Spring Security, the panel says that it’s disabled.

Like the rest of Copilot, it’s only there in development mode.