SSO auth app open window in dialog mode after login show twice

Hello,

I want to open a window in dialog mode after authentication.

For this I create a mainWindow with the following code


public class ExtAppMainWindow extends AppMainWindow {
    @Override
    public void ready() {
        super.ready();
        openWindow("testWindow", WindowManager.OpenType.DIALOG)
            .addCloseListener(actionId ->
                showMessageDialog("", "blah blah", MessageType.WARNING));
    }
}

The problem is after login, testWindow is show twice.
I attached a test project

Hi,

What SSO approach do you use? Custom or IdpAuthProvider from the platform?

It seems that attachment is missing. Could you please attach your project again?

Hi,
I forgot to attach.

idpauth.zip (76.6K)

Thank you for reporting the problem. We will fix it in the very next maintenance version of the Release 6.5, it will be 6.5.6 I believe.
At the moment you can use the following workaround:

  1. Create CustomAppUI class:
public class CustomAppUI extends AppUI {
    protected void setupUI() throws LoginException {
        if (!app.getConnection().isConnected()) {
            if (!((CustomApp) app).loginOnStart()) {
                app.getConnection().loginAnonymous(app.getLocale());
            }
        } else {
            app.createTopLevelWindow(this);
        }
    }
}
  1. Register it in web-spring.xml:
<bean id="cuba_AppUI" class="com.company.idpauth.web.CustomAppUI" scope="prototype"/>
  1. In your app class override loginOnStart method with “public” access modifier:
public class CustomApp extends DefaultApp {
    @Override
    public boolean loginOnStart() {
        return super.loginOnStart();
    }
}

I’ve attached fixed version of your demo project. Thank you for the bug report!

idpauth.zip (77.0K)

Hi,
The problem is fixed in the platform version 6.5.6.

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-9295