Authenticate user in module

Hello everybody,
I’m trying to authenticate a user through my module. In Python i use system.security.validateUser(user,password,userSource)
I need to find the same functionality in Java.

Thank you.

What scope do you need to do this from? (Gateway or Client)

I need Gateway scope

From GatewayContext you can get the UserSourceManager, from which you can get a UserSourceProfile, which has an authenticate(AuthChallenge) method.

Thank you Kevin, finally I managed to log in and retrieve user’s info.