Adobe 刚刚发布了 ActionScript OAuth 2.0 版本,ActionScript OAuth 是 Adobe 官方的一个 ActionScript 编程语言的 OAuth 的开发包。
示例代码:
// set up our StageWebView object to use our visible stage stageWebView.stage = stage; // set up the call var oauth2:OAuth2 = new OAuth2("https://accounts.google.com/o/oauth2/auth", "https://accounts.google.com/o/oauth2/token", LogEventLevel.DEBUG); var grant:IGrantType = new AuthorizationCodeGrant(stageWebView, "INSERT_CLIENT_ID_HERE", "INSERT_CLIENT_SECRET_HERE", "http://www.mysite.com", "https://www.googleapis.com/auth/userinfo.profile"); // make the call oauth2.addEventListener(GetAccessTokenEvent.TYPE, onGetAccessToken); oauth2.getAccessToken(grant); function onGetAccessToken(getAccessTokenEvent:GetAccessTokenEvent):void { if (getAccessTokenEvent.errorCode == null && getAccessTokenEvent.errorMessage == null) { // success! trace("Your access token value is: " + getAccessTokenEvent.accessToken); } else { // fail :( } } // onGetAccessToken
示例应用截图:

手机上的演示程序:
ActionScript OAuth 2.0 Mobile Demo Application
ActionScript OAuth 的下载地址:请点这里
