CustomLoginProvider

Hello,
I am trying to authenticate through another database than the default one created by CUBA.
I am new to the subject and have read the web login doc and the creation of a CustomLoginProvider. Now I don’t see where to start.
I created a class CustomLoginProvider
who sends me back
INFO c.h.cuba.web.app.login.LoginScreen - Login failed: com.haulmont.cuba.security.global.UnsupportedCredentialsException: Unable to find login provider that supports credentials class com.haulmont.cuba.security.auth.LoginPasswordCredentials
in the method
@Override
public boolean supports(Class credentialsClass) {
return false;
}

Hi,
What you are trying to do - is not a trivial task, and I would recommend to use for external authentication such ready to use addons as SAML or LDAP instead:

If you want to implement another way of logging in by login/password - you need to create a bean in the core module. The bean should copy the logic of the com.haulmont.cuba.security.auth.providers.LoginPasswordAuthenticationProvider
(Except that it should load user details from another database).
But this is not enough, because the User entity in CUBA is linked to another entities, such as sec$UserRole. In fact, if you make an external authentication, you also need to automatically create a sec$User copy of the user in the main CUBA database after each successful external authentication, so that you can assign user roles and other entities to this user in the local DB.