Using two different columns for password with Elyctron JDBC realm

28 views Asked by At

I have table with users that have 3 columns: login, password, guid - columns password and guid both hold some (but different) "password". When user login into system it can provide login and password or login and guid (depending on which frontend it is using). I need to configure WildFly (version 28) Elytron so, that it will try authenticate user first with login and password and when authentication failed, it will try authenticate it with login and guid.

We tried defined two jdbc realms - one for first option with column "password" and one for second option with column "guid" - and then use distributed realm that containts these two realms. Problem is, that login is in both cases same. So when trying login with login/guid user is found with first query (that select column password), but password doesn't match (as we compare guid against password column). As user war found, Elytron doesn't continue to second principal query and login as whole failed. We need that Elyctron will try both realms/queries in authentication process.

0

There are 0 answers