{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/WebHooks/issues/21","labels_url":"https://api.github.com/repos/aspnet/WebHooks/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/WebHooks/issues/21/comments","events_url":"https://api.github.com/repos/aspnet/WebHooks/issues/21/events","html_url":"https://github.com/aspnet/WebHooks/issues/21","id":113591559,"number":21,"title":"[Question] How do we pass authentication data to a web hook handler?","user":{"login":"elkdanger","id":766403,"avatar_url":"https://avatars.githubusercontent.com/u/766403?v=3","gravatar_id":"","url":"https://api.github.com/users/elkdanger","html_url":"https://github.com/elkdanger","followers_url":"https://api.github.com/users/elkdanger/followers","following_url":"https://api.github.com/users/elkdanger/following{/other_user}","gists_url":"https://api.github.com/users/elkdanger/gists{/gist_id}","starred_url":"https://api.github.com/users/elkdanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elkdanger/subscriptions","organizations_url":"https://api.github.com/users/elkdanger/orgs","repos_url":"https://api.github.com/users/elkdanger/repos","events_url":"https://api.github.com/users/elkdanger/events{/privacy}","received_events_url":"https://api.github.com/users/elkdanger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-27T14:10:39Z","updated_at":"2015-10-27T14:39:54Z","closed_at":null,"body":"For example, in the Instagram web hook handler example. On the back of handling a web hook request, if I wanted to then connect to Instagram's API to retrieve more information about the image I would need an access token. I have the token currently stored in the session, but what's the pattern for getting such a thing through to the handler from my application?"},"comment":{"url":"https://api.github.com/repos/aspnet/WebHooks/issues/comments/151522104","html_url":"https://github.com/aspnet/WebHooks/issues/21#issuecomment-151522104","issue_url":"https://api.github.com/repos/aspnet/WebHooks/issues/21","id":151522104,"user":{"login":"HenrikFrystykNielsen","id":1203075,"avatar_url":"https://avatars.githubusercontent.com/u/1203075?v=3","gravatar_id":"","url":"https://api.github.com/users/HenrikFrystykNielsen","html_url":"https://github.com/HenrikFrystykNielsen","followers_url":"https://api.github.com/users/HenrikFrystykNielsen/followers","following_url":"https://api.github.com/users/HenrikFrystykNielsen/following{/other_user}","gists_url":"https://api.github.com/users/HenrikFrystykNielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/HenrikFrystykNielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HenrikFrystykNielsen/subscriptions","organizations_url":"https://api.github.com/users/HenrikFrystykNielsen/orgs","repos_url":"https://api.github.com/users/HenrikFrystykNielsen/repos","events_url":"https://api.github.com/users/HenrikFrystykNielsen/events{/privacy}","received_events_url":"https://api.github.com/users/HenrikFrystykNielsen/received_events","type":"User","site_admin":false},"created_at":"2015-10-27T14:39:54Z","updated_at":"2015-10-27T14:39:54Z","body":"Just to answer your cookie question first: you can get your cookies from the HttpRequestMessage in the context passed to the handler as described here [1].\r\n\r\nTo clarify a bit on where tokens are needed, Instagram has four different ways you can subscribe: based on users, tags, location-tagging, and geo-location. For geo-location subscriptions you don't need a token to get additional information about the images (this is what you see in the sample where we use the InstagramWebHookClient to get additional information about the images). \r\n\r\nHowever, for the other kinds of subscriptions you do need a token representing a particular user. Once you have a token, you can submit your own request to Instagram for additional information about the image. InstagramWebHookClient only supports getting additional information for geo-location subscriptions.\r\n\r\nHenrik\r\n\r\n[1] http://www.asp.net/web-api/overview/advanced/http-cookies\r\n\r\n"}}