开发者

GET Twitter user & token URLs

On his blog post about LROAuth2Client - OAuth2 for iPhone and iPad applications, Luke Redpath states:

If possible, you should try and obtain the end-user and token URIs at runtime rather than hardcoding them into your application. This can be typically done by making an unauthorised request to a secure URI and obtaining them from the WWW-Authenticate header in the开发者_如何学Go returned 401 response.

Please provide example code of how this is done in order to implement Sign in with Twitter on iOS.


According to @alancfrancis on Twitter, "You just hard code them."

I think these are the correct URLs:

#define kTwitterTokenURL @"http://api.twitter.com/oauth/request_token"
#define kTwitterUserURL  @"https://api.twitter.com/oauth/authorize"


Twitter does not currently support Oauth 2. You will have to use OAuth 1.0a. The WWW-Authenticate header returned from Twitter does not contain the token URIs so you will have to hardcode them in your application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜