throw exceptions in the appropriate areas in authentication service.