Obtaining user from custom SPI

Hi, I need to be able to get user details by its ID inside my custom SPI, is there a way to do that except connecting to keycloak database directly? So I don’t need to implement any custom user storages, I just want to get user from current storage like keycloak server’d do it itself.