I have developed an User Storage Provider SPI which looks into a customer DB for user authentication (username + password).
In the getUserByUsername(...) method I execute