Add the authentication middleware for service.