Authenticating with Stack Overflow programmatically

荒凉一梦 提交于 2020-01-01 19:11:22

问题


I would like to add up and down voting to my iPhone application - MyStacks. for this I need the to be able to authenticate the user with Stack Overflow.

I'm look at adapting the Twitter-OAuth-iPhone library. However the problem I have is obtaining the consumer and secret key. to use OAuth, do I need to obtain a different key for each provider? In order to obtain a consumer key from Google the application needs to have a domain name, but this being an iPhone app of course I don't have one. Does this mean that I can't use OAuth?

Is there any other way to programmatically authenticate with Stack Overflow?


回答1:


Found the solution, on the iPhone its surprisingly simple. Just embed a UIWebView which opens up the SO login page and then once users authenticates themselves the required cookies will be saved using NSHTTPCookieStorage so you can simply use NSURLRequest as normal.



来源:https://stackoverflow.com/questions/2492174/authenticating-with-stack-overflow-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!