Authentication for REST endpoints.