对新浪微博 api Oauth认证.第三方工具的懂得

对新浪微博 api Oauth认证.第三方工具的理解

<!-- [if gte mso 9]><xml><w:WordDocument><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery><w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery><w:DocumentKind>DocumentNotSpecified</w:DocumentKind><w:DrawingGridVerticalSpacing>7.8</w:DrawingGridVerticalSpacing><w:View>Normal</w:View><w:Compatibility></w:Compatibility><w:Zoom>0</w:Zoom></w:WordDocument></xml><![endif]-->

OAUTH协议简介

http://blog.csdn.net/hereweare2009/archive/2009/03/08/3968582.aspx

微博第三方应用

1、 注册应用得到 App Key Secret Key oauth_consumer_key oauth_consumer_key )标示应用程序 id

2、 用户向服务器B 请求 request

3、 服务器B 响应请求,服务器向微博服务器 A 发出请求(带上 App Key ),微博服务器A 响应请求,将( oauth_token 与对应的 oauth_token_secret )作为响应内容返回。服务器将产生的页面作为响应内容返回给用户

4、 用户单击链接,微博服务器B 响应请求( oauth_tokeno auth_callback ),将生成页面返回给用户

5、 用户输入用户名称、密码,微博服务器B 响应请求( oauth_token oauth_callback )成功的话,服务器响应定向到 auth_callback 地址和一些参数

第三方应用可以通过微博服务器B 提供的相依 API 得到你的信息,和做一些操作

 

<a id="btn" title="进入微博授权 " href="http://api.t.sina.com.cn/oauth/authorize?oauth_token= 3ae7c75c5ef890f52267b53a73531ea4 &oauth_callback= http%3A%2F%2Fmanhua.sinaapp.com%2Fcallback.php " >进入微博授权 </a>

  <form name="authZForm" action="authorize" method="post">

   <input type="hidden" name="regCallback" value="http%3A%2F%2Fapi.t.sina.com.cn%2Foauth%2Fauthorize%3Foauth_token% 3D3ae7c75c5ef890f52267b53a73531ea4 %26oauth_callback%3Dhttp%3A%2F%2Fmanhua.sinaapp.com%2Fcallback.php%26from%3D"/>

   <input type="hidden" name="oauth_token" value=" 3ae7c75c5ef890f52267b53a73531ea4 "/>

               <input type="hidden" name="oauth_callback" value=" http://manhua.sinaapp.com/callback.php "/>  <input type="hidden" name="from" value=""/>

              <div class="left">帐号: </div>

              <div class="cen"><input id="userId" name="userId" value="" type="text" tabindex="1" /></div>

              

              <div class="left">密码: </div>

              <div class="cen"><input  id="passwd" name="passwd" type="password" tabindex="2"/></div>

      </li>

          </ul>

        </div>

  

          <div class="rt">

          <input type="submit" style="width:1px;heigth:1px;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;" tabindex="3"/>

          <a href="#" class="newbbtngrn" onclick="GB_SUDA._S_uaTrack('tblog_api','58berR_authorization');authZForm.submit();"><em>授权 </em></a>

          <a href="#" class="btn_gray" onclick="GB_SUDA._S_uaTrack('tblog_api','58berR_cancel');window.close();"><em>取消 </em></a>

          </div>

        </div>

        </form>


对新浪微博 api Oauth认证.第三方工具的懂得