Add example and e2e tests for authorization