Login with email-address (and social login)


Cuba Platform standard has usernames for login. Is it possible to make users login with emailadresses instead of login names?

If yes, how is this possible?

Kind regards,



Why is this question not answered?

Kind regards,

Hello Abdel,

Thank you for the heads up! We try our best to meet expectations of our community working hard with limited resourses. We answer questions in order of appearance keeping in mind the complexity of the topic. Please, don’t forget that this forum is free and you can’t expect your question being answered within a certain time. If swiftness is an issue you can always buy SLA or consulting hours. We’ll try to asnwer your question asap.


Hi Andrey,

Thank you.
I will wait for the answer.

Kind regards,


At the moment our authentication mechanism is not so flexible as we want. We are planning to rework it in release 6.7.
See this ticket for details: https://youtrack.cuba-platform.com/issue/PL-9404

In case of email login in web client there is a simple workaround to enable it.

  1. Extend loginWindow screen using Studio: Generic UI - New - Login Window
  2. Override doLogin and doLoginRememberMe methods:

public class ExtAppLoginWindow extends AppLoginWindow {
    private DataService dataService;

    protected void doLogin(String login, String password, Locale locale) throws LoginException {
        super.doLogin(findLoginByEmail(login), password, locale);

    protected void doLoginByRememberMe(String login, String rememberMeToken, Locale locale) throws LoginException {
        super.doLoginByRememberMe(findLoginByEmail(login), rememberMeToken, locale);

    private String findLoginByEmail(String email) throws LoginException {
        if (!email.contains("@")) {
            return email;
        // find user login by email using dataService
        List<User> users = dataService.loadList(LoadContext.create(User.class)
                .setQuery(new LoadContext.Query("select u from sec$User u where u.email = :email")
                        .setParameter("email", email)));

        if (users.isEmpty()) {
            throw new LoginException("Unable to find user");

        return users.get(0).getLogin();

Alternative solution - create a user with the login that is equal to email. In this case don’t need to extend loginWindow and perform conversion.

As for social login, now there is no simple way to create custom authentication for web application and REST-API.

We have implemented necessary external mechanisms for REST-API in release 6.6 and prepared demo with facebook login for web application.
We will share demos and documentation on this topic right after 6.6 release.