oauth - iphone或android如何利用新浪微博客户端进行应用授权?
迷茫
迷茫 2017-04-17 11:05:02
0
5
454

现在比较常用的几种授权方式是利用webview打开授权页面或者是native的输入框获取用户名密码来向新浪提交验证,返回token的方法。
但我发现唱吧利用了新浪的移动客户端,当要授权时,跳转到微博应用里,点授权后再跳转回来。这样大大降低了新浪微博登陆的成本,用户用起来也方便,特别是现在新浪要求oauth2.0的情况下(初级应用7天过期)。

问:如何做到唱吧的授权方式,是否需要微博的高级权限或者,唱吧是和新浪做的深度合作,这种接口不对外开放?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(5)
阿神

Changba uses the SSO authorized login method. You can send me the appkey on Weibo and I will give you the corresponding SDK

Supplementary document address

http://open.weibo.com/wiki/移%...

伊谢尔伦

Weibo Open Platform officially releases SSO SDK

Currently supports SSO client version (SDK will identify the version and be backward compatible with WebView)
1. Android Weibo client 3.0.0 and above
2. iPhone version of Weibo client 3.0.0 and above
3. iPad version of Weibo client 2.9.0 and above

If the Weibo client is not installed on the user's mobile phone, the oauth2.0 web authorization method will be enabled to complete the authorization.

小葫芦

Reverse the IPA file of Sina Weibo. You can find that the Sina Weibo client has scheme in the info.plist file. In theory, it can be called by third parties. Its scheme is sinaweibo, that is It says that it can be called as follows

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sinaweibo://..."]];

As for the calling rules behind sinaweibo://, I haven’t found any official documents. I hope someone with knowledge can reveal it. I’m just here to give you some advice

洪涛

In this case, users must have the Weibo application installed on their mobile phones

黄舟

Sina Weibo’s official SDK provides two verification methods.

2. Web authentication
Interface name: (void)login
Return result: None
3. Client-side authentication
Use the default interface provided by the SDK to send Weibo
Interface name: (void)logInUsingUserID:(NSString *)theUserID password:(NSString *)thePassword

The second one obviously does not meet your requirements. It is recommended that you test the first one on a mobile phone with Sina client installed, just in case it jumps internally~~~

The link is here: http://open.weibo.com/wiki/IOS_SDK#.E...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template