Create a java action with a call to the method Core.authenticate(IContext context, IUser user, java.lang.String password)
As passwords are (and shouold be) stored encrypted hashes there is no way to retrieve the data for the password.
For more information on the java method see: https://apidocs.rnd.mendix.com/8/runtime/com/mendix/core/Core.html#authenticate(com.mendix.systemwideinterfaces.core.IContext,com.mendix.systemwideinterfaces.core.IUser,java.lang.String)