Extracted authentication methods from application controller.