Update authenticator.java

Added validation method call. moved accessing username and password to inside this class.