Added a method for checking credentials

The method also throws the new WrongCredentialsException