Android App如何使用OAuth 2.0进行登陆的


开发Android App,使用新浪微博的OAuth 2.0 API进行登陆,如何获得授权 access_token 呢?还是只能通过 用户名/密码 进行登陆?

我知道网页应用可以请求 https://api.weibo.com/oauth2/authorize ;然后跳转到 redirect_uri 页面来获取 code state ;然后再请求 https://api.weibo.com/oauth2/access_token 获取 access_token 。但在Android App中如何设置 redierct_uri ?

另外:如果自己实现一个OAuth 2.0 Server服务,让第三方知道用户名和密码是否有安全隐患?

Android oauth2 新浪微博

Pojet 10 years, 10 months ago

对于Mobile客户端应用来说,是不存在Server的,redirect_uri只要与新浪微博开放平台->我的应用->应用信息->高级应用->授权设置->应用回调页中的url地址保持一致就可以了。

404011 answered 10 years, 10 months ago

Your Answer