c# - 403 error from HttpWebResponse Instagram -


first of sorry bad english. task authenticate in instagram api. when try token after user clicked "ok" 403 error httpwebresponse , can't token:(. don't know do. me please. , when enter link in me browser - it's ok

httpwebrequest request = (httpwebrequest)httpwebrequest.create("https://instagram.com" + url); request.useragent = "mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/42.0.2311.90 safari/537.36"; request.method = "post"; request.cookiecontainer = cookies; request.accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"; request.headers.add("accept-encoding: gzip, deflate"); request.headers.add("accept-language: ru-ru,ru;q=0.8,en-us;q=0.6,en;q=0.4"); request.headers.add("cache-control:max-age=0"); request.contenttype = "application/x-www-form-urlencoded"; request.host = "instagram.com"; request.headers.add("origin: https://instagram.com"); streamwriter writer = new streamwriter(request.getrequeststream()); writer.write("csrfmiddlewaretoken=" + par + "&username=login&password=password"); writer.close(); httpwebresponse response = (httpwebresponse)request.getresponse(); //403 erorr 

you cannot access token sending username/password pair api! have direct real user instagram's authorization url, , after user logged in instagram send application code used getting access token.

more information: https://instagram.com/developer/authentication/


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -