online account workshop

所需积分/C币:10 2015-02-03 21:10:08 180KB PDF
收藏 收藏
举报

Ubuntu平台上的online account介绍
What is Online Accounts? Online accounts overview End users Service Applications Providers Scopes (Google, Facebook (click) X11 Desktop Online Apps Online (uncon fined) Accounts Framework Identities QA automation (c)2014 Canonical Online accounts overview System Settings Online Ubuntu Settings (USSOA Accounts signon UI Apps Identity API Scopes (click) signon d API key OA Plugins Config files (OAuth Desktop Service Apps Providers (X11) (Google, Facebook 3rd-party plugins (identity, service) Auth/ Sign-in (c)2014 Canonical Bindings for App developers Online accounts ap In order to use Online accounts, an application or a scope needs to define app service file, with app-specific settings for the account <?xml version="1.0 encoding="UTF-8?> <service> <provider>facebook</provider> <template> <group name="auth/oauth2/user agent"> <setting type="as" name="Scope>[ publish_actions,user_photos ]</setting> <setting name="ClientId">162709212093</setting> /group> </template> </service> app application file, listing the account services being used <?xml version="1.0 encoding="UTF-8?> <application> <services> <service id="com. ubuntu. developer. me facebook-photos"> <description>Post your pictures to Facebook</description> </service> </services> </application> Online accounts ap (continued) s manifest ison hooks":t facebook-photos":t apparmor. app.Json account-application":app. application"> account-service":app. service Online Accounts permission in app. json file policy_groups":[ networking", accounts policy version": 1.1 Online Accounts QML APl import Ubuntu. OnlineAccounts 0.1 import Ubuntu. OnlineAccounts client 0.1 AccountServiceModel i id accounts applicationId: com. ubuntu. developer. me facebook-photos Repeater i model: accounts delegate: Accountservice id: accountService objectHandle: model. accountServiceHandle function getToken ()i authenticate(null); unAuthenticated: i OAuth token= reply. AccessToken; onAuthenticationError: i console. log ("Authentication failed, code "+error code) Setup id: setup applicationId: com. ubuntu. developer me facebook -photos onAccountNeeded: setup execo Online Accounts HTMl5/JS API s Initialize the context var api= external. getUnityobject(1.0) var oa=api.OnlineAccounts; S Enumerate providers if necessary) oa api. getProviders(i"applicationId":webbrowser-app"), function (providers //from here access providers] each provider having a display name a providerId etc S Enumerate accounts available for a defined provider oa api. getAccounts(filters, function (accounts)i if (accounts. length!==0t for(var i=0;i< accounts. length ;++i) console. log(accounts[i]. accountIdo) e Authenticate with a particular identity(account) / From an Account object retrieved by a getAccounts( call function authcallback(results)i / Access to a dictionary of results, with e. g. AccessToken etc console. log authentication result: + JSoN. stringify (results)) accounts[i]. authenticate (authcallback) Note: To create a new account. refer to the api documentation

...展开详情
试读 20P online account workshop
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    抢沙发
    一个资源只可评论一次,评论内容不能少于5个字
    上传资源赚积分,得勋章
    最新推荐
    online account workshop 10积分/C币 立即下载
    1/20
    online account workshop第1页
    online account workshop第2页
    online account workshop第3页
    online account workshop第4页
    online account workshop第5页
    online account workshop第6页

    试读已结束,剩余14页未读...

    10积分/C币 立即下载 >