login authentication method in api