Made java-implementation for login, should report login result correctly.