{"action":"created","issue":{"url":"https://api.github.com/repos/App-vNext/Polly/issues/122","repository_url":"https://api.github.com/repos/App-vNext/Polly","labels_url":"https://api.github.com/repos/App-vNext/Polly/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/App-vNext/Polly/issues/122/comments","events_url":"https://api.github.com/repos/App-vNext/Polly/issues/122/events","html_url":"https://github.com/App-vNext/Polly/issues/122","id":159701630,"number":122,"title":"Call an authenticate method before retrying","user":{"login":"reisenberger","id":9608723,"avatar_url":"https://avatars.githubusercontent.com/u/9608723?v=3","gravatar_id":"","url":"https://api.github.com/users/reisenberger","html_url":"https://github.com/reisenberger","followers_url":"https://api.github.com/users/reisenberger/followers","following_url":"https://api.github.com/users/reisenberger/following{/other_user}","gists_url":"https://api.github.com/users/reisenberger/gists{/gist_id}","starred_url":"https://api.github.com/users/reisenberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reisenberger/subscriptions","organizations_url":"https://api.github.com/users/reisenberger/orgs","repos_url":"https://api.github.com/users/reisenberger/repos","events_url":"https://api.github.com/users/reisenberger/events{/privacy}","received_events_url":"https://api.github.com/users/reisenberger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/App-vNext/Polly/labels/how-to","name":"how-to","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-10T19:07:09Z","updated_at":"2016-07-07T12:05:59Z","closed_at":null,"body":"@robertbaker asked under a separate issue (moving here as worth calling out as own issue!)\r\n\r\n>I have a scenario for web requests.\r\n\r\n>Say I make a httpClient call that throws a 403. On a 403, I want to \r\n>call my authenticate method first then retry the method.\r\n\r\n>I don't think this is possible currently with polly. If it is please give me an example!"},"comment":{"url":"https://api.github.com/repos/App-vNext/Polly/issues/comments/231059034","html_url":"https://github.com/App-vNext/Polly/issues/122#issuecomment-231059034","issue_url":"https://api.github.com/repos/App-vNext/Polly/issues/122","id":231059034,"user":{"login":"reisenberger","id":9608723,"avatar_url":"https://avatars.githubusercontent.com/u/9608723?v=3","gravatar_id":"","url":"https://api.github.com/users/reisenberger","html_url":"https://github.com/reisenberger","followers_url":"https://api.github.com/users/reisenberger/followers","following_url":"https://api.github.com/users/reisenberger/following{/other_user}","gists_url":"https://api.github.com/users/reisenberger/gists{/gist_id}","starred_url":"https://api.github.com/users/reisenberger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reisenberger/subscriptions","organizations_url":"https://api.github.com/users/reisenberger/orgs","repos_url":"https://api.github.com/users/reisenberger/repos","events_url":"https://api.github.com/users/reisenberger/events{/privacy}","received_events_url":"https://api.github.com/users/reisenberger/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T12:05:59Z","updated_at":"2016-07-07T12:05:59Z","body":"@adamhathcock You raised OAuth and Polly on #90, see this thread #122. One pattern is to use the `onRetry` delegate (which gets executed between tries), so, in its simplest schematic form, something like:\r\n\r\n```csharp\r\nvar authorisationEnsuringPolicy = Policy\r\n  .Handle<AuthorizationException>()\r\n  .Retry(1, onRetry: (e, i) => RefreshAuthorization());\r\n\r\nauthorisationEnsuringPolicy.Execute(() => DoSomethingThatRequiresAuthorization());\r\n```\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"reisenberger"}}