Screen link and anonymous access

I have created a simple screen with just 1 textfield.

I want to call this screen anonymously from an external application with a screen link.

I created an “Anonymous” role and assigned this role to the “Anonymous” user and gave access to just this specific screen. Unfortunately I am still required to login.

What am I missing?

Hi Torben,

At the moment, you can use LinkHandler to open custom Windows in anonymous mode only if you extend it. In order to show custom window for anonymous by a screen link you can do the following:

  1. Add your custom action name to cuba.web.linkHandlerActions property in file:
cuba.web.linkHandlerActions = open|o|demo

We will use http://localhost:8080/app/demo URL to show custom main window.

  1. Extend LinkHandler class and override handle (and canHandleLink, if needed) methods
public class DemoLinkHandler extends LinkHandler {
    public DemoLinkHandler(App app, String action, Map<String, String> requestParams) {
        super(app, action, requestParams);

    public boolean canHandleLink() {
        if ("demo".equals(action)) {
            return true;

        return super.canHandleLink();

    public void handle() {
        if ("demo".equals(action)) {
            try {
                // open custom main window
            } finally {
                VaadinRequest request = VaadinService.getCurrentRequest();
                WrappedSession wrappedSession = request.getWrappedSession();
        } else {
  1. Create a custom window based on Blank Screen template and change the base class of it to AbstractMainWindow
public class DemoScreen extends AbstractMainWindow {

  1. Let’s show a simple table with users as the content of this demo window (I’ve created it in Studio Screen Designer):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns=""

        <collectionDatasource id="usersDs"
                select u from sec$User u

    <layout spacing="true"
        <label stylename="h1"
               value="Demo Screen"/>

        <table id="table" width="100%">
                <column id="active"/>
                <column id="login"/>
                <column id="name"/>
                <column id="position"/>
            <rows datasource="usersDs"/>
  1. Register your custom LinkHandler implementation in web-spring.xml file:
<bean id="cuba_LinkHandler"

If we restart the application and open http://localhost:8080/app/demo URL and login then application will show us custom main window instead of default.

Moreover, we can navigate to this screen from our application screens using the same approach:


Using this approach you will be able to create screens visually using CUBA Studio and use all the features of CUBA: entities, services, etc.

Please note, that if you embed this page to a client faced web site - web browsers will download all the web resources required for web application including widget set with size of 1+ MB (it will be cached, but usually it is not suitable for public web sites). If you want to embed your application to public facing portal I’d recommend that you have a look at portal module where you will be able to use traditional Spring Web MVC approach to generate web pages.

Also, there is one known drawback - standard main / login window will be initialized before your custom window.

Complete demo code is located here: GitHub - cuba-labs/embeddable-screen-link


Perfect - It just works !

Thanks for the very detailed explanation. It will be used on the intranet, so I don’t expect problems with the size of the widget set.