539 lines
No EOL
26 KiB
HTML
539 lines
No EOL
26 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head><meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
|
<title>App Authentication · Tent - the decentralized social web</title>
|
|
<link href="/assets/css/bootstrap-cb0b9b6b1fd.css" media="screen" rel="stylesheet" type="text/css" />
|
|
<link href="/assets/css/bootstrap-responsive-cb034fa29d4.css" media="screen" rel="stylesheet" type="text/css" />
|
|
<link href="/assets/css/style-cba5092b759.css" media="screen" rel="stylesheet" type="text/css" />
|
|
<link href="/blog.xml" rel="alternate" title="Atom feed" type="application/atom+xml" />
|
|
<script type="text/javascript">var _gaq = _gaq || [];
|
|
_gaq.push(['_setAccount', 'UA-34258323-1']);
|
|
_gaq.push(['_setSiteSpeedSampleRate', 50]);
|
|
_gaq.push(['_trackPageview']);
|
|
(function() {
|
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
})();</script></head>
|
|
<body><div class="navbar navbar-static-top">
|
|
<div class="navbar-inner">
|
|
<a class="brand" href="/">Tent</a>
|
|
<ul class="nav"><li ><a href="/blog">Blog</a></li><li class="active"><a href="/docs">Docs</a></li></ul>
|
|
</div>
|
|
</div><div class="container doc">
|
|
<div class="row">
|
|
<div class="span2">
|
|
<ul class="nav nav-list well">
|
|
<li class="nav-header">Tent</li>
|
|
<li><li ><a href="/docs">Protocol Introduction</a></li></li>
|
|
<li><li ><a href="/docs/server-protocol">Server Protocol</a></li></li>
|
|
<li><li class="active"><a href="/docs/app-auth">App Authentication</a></li></li>
|
|
<li><li ><a href="/docs/app-server">Server API for Apps</a></li></li>
|
|
<li class="nav-header">Types</li>
|
|
<li><li ><a href="/docs/post-types">Post Types</a></li></li>
|
|
<li><li ><a href="/docs/info-types">Profile Info Types</a></li></li>
|
|
</ul>
|
|
</div>
|
|
<div class="span8">
|
|
<div class="alert alert-block">
|
|
<h4>Alpha Documentation </h4>
|
|
<p>These docs are very rough, incorrect, and incomplete. They will be modified heavily over the next few weeks.</p>
|
|
<p>Please contribute by making Pull Requests and Issues on the <a href="https://github.com/tent/tent.io">GitHub repository</a>.</p>
|
|
</div><h2>App Authentication</h2>
|
|
|
|
<p>Tent uses <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-31">OAuth 2</a> for app
|
|
authentication. Because of the distributed nature of Tent, it is necessary for
|
|
apps to register with the Tent entity before doing the authentication flow.</p>
|
|
|
|
<p>After the authentication flow, requests are authenticated using the credentials
|
|
with <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01">MAC Access
|
|
Authentication</a>.</p>
|
|
|
|
<h3>App Registration</h3>
|
|
|
|
<p>Before authenticating a user, the application must be registered with the
|
|
specified Tent entity. The first step is to perform discovery on the provided
|
|
entity url.</p>
|
|
<div class="highlight"><pre>HEAD / HTTP/1.1
|
|
Accept: application/vnd.tent.v0+json
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre>HTTP/1.1 200 OK
|
|
Content-Type: text/html
|
|
Link: </profile>; rel="https://tent.io/rels/profile"
|
|
</pre>
|
|
</div>
|
|
|
|
<p>The next step is to register the application with the server. Registration
|
|
specifies some details about the app, as well as the exact <code>redirect_uris</code> that
|
|
will be used during the OAuth flow. The response <code>id</code>, <code>secret</code>, and
|
|
<code>mac_algorithm</code> are used to authenticate future requests to the Tent server.
|
|
The <code>id</code> is used as the <code>client_id</code> in all OAuth requests.</p>
|
|
<div class="highlight"><pre>POST /apps HTTP/1.1
|
|
Content-Type: application/vnd.tent.v0+json
|
|
Accept: application/vnd.tent.v0+json
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre><span class="p">{</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"FooApp"</span><span class="p">,</span>
|
|
<span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Does amazing foos with your data"</span><span class="p">,</span>
|
|
<span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://example.com"</span><span class="p">,</span>
|
|
<span class="nt">"icon"</span><span class="p">:</span> <span class="s2">"http://example.com/icon.png"</span><span class="p">,</span>
|
|
<span class="nt">"redirect_uris"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://app.example.com/tent/callback"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"scopes"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"write_profile"</span><span class="p">:</span> <span class="s2">"Uses an app profile section to describe foos"</span><span class="p">,</span>
|
|
<span class="nt">"read_followings"</span><span class="p">:</span> <span class="s2">"Calculates foos based on your followings"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre>HTTP/1.1 200 OK
|
|
Content-Type: application/vnd.tent.v0+json
|
|
Content-Length: 459
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre><span class="p">{</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"FooApp"</span><span class="p">,</span>
|
|
<span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Does amazing foos with your data"</span><span class="p">,</span>
|
|
<span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://example.com"</span><span class="p">,</span>
|
|
<span class="nt">"icon"</span><span class="p">:</span> <span class="s2">"http://example.com/icon.png"</span><span class="p">,</span>
|
|
<span class="nt">"redirect_uris"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://app.example.com/tent/callback"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"scopes"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"write_profile"</span><span class="p">:</span> <span class="s2">"Uses an app profile section to describe foos"</span><span class="p">,</span>
|
|
<span class="nt">"read_followings"</span><span class="p">:</span> <span class="s2">"Calculates foos based on your followings"</span>
|
|
<span class="p">},</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"p0cq4m"</span><span class="p">,</span>
|
|
<span class="nt">"mac_key_id"</span><span class="p">:</span> <span class="s2">"a:f665629b"</span><span class="p">,</span>
|
|
<span class="nt">"mac_key"</span><span class="p">:</span> <span class="s2">"6cda8195d50bb55fb17d22de3f7575de"</span><span class="p">,</span>
|
|
<span class="nt">"mac_algorithm"</span><span class="p">:</span> <span class="s2">"hmac-sha-256"</span><span class="p">,</span>
|
|
<span class="nt">"authorizations"</span><span class="p">:</span> <span class="p">[</span>
|
|
|
|
<span class="p">]</span>
|
|
<span class="p">}</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<h4>App JSON Schema</h4>
|
|
<table class="table table-striped table-bordered">
|
|
<thead >
|
|
<tr>
|
|
<th>Property</th>
|
|
<th>Required</th>
|
|
<th>Type</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody >
|
|
<tr>
|
|
<td><code>id</code></td>
|
|
<td>Optional</td>
|
|
<td>String</td>
|
|
<td>The unique identifier of the app.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>name</code></td>
|
|
<td>Required</td>
|
|
<td>String</td>
|
|
<td>The short display name for the app.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>description</code></td>
|
|
<td>Required</td>
|
|
<td>String</td>
|
|
<td>The short display description of the app.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>url</code></td>
|
|
<td>Required</td>
|
|
<td>String</td>
|
|
<td>The URL for the home page of the app.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>icon</code></td>
|
|
<td>Optional</td>
|
|
<td>String</td>
|
|
<td>The URL to the icon for the app.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>redirect_uris</code></td>
|
|
<td>Required</td>
|
|
<td>Array</td>
|
|
<td>The exact (including parameters) uris that will be used as OAuth <code>redirect_uri</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>scopes</code></td>
|
|
<td>Required</td>
|
|
<td>Object</td>
|
|
<td>All of the scopes that the application will use, and the reason why each is required.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mac_algorithm</code></td>
|
|
<td>Optional</td>
|
|
<td>String</td>
|
|
<td>The MAC algorithm to use when authenticating the app.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mac_key_id</code></td>
|
|
<td>Optional</td>
|
|
<td>String</td>
|
|
<td>The MAC key identifier to use when authenticating the app.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mac_key</code></td>
|
|
<td>Optional</td>
|
|
<td>String</td>
|
|
<td>The MAC key to use when authenticating the app.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3>Authentication Flow</h3>
|
|
|
|
<h4>Auth Request</h4>
|
|
|
|
<p>The app requests the user's Tent identifier, and performs discovery on it to
|
|
find the Tent API root. The app then builds an auth request and redirects the
|
|
user-agent to it:</p>
|
|
<div class="highlight"><pre>/oauth/authorize?client_id=p0cq4m
|
|
&redirect_uri=http://app.example.com/tent/callback
|
|
&scope=read_posts,read_profile
|
|
&state=87351cc2f6737bfc8ba
|
|
&tent_profile_info_types=https://tent.io/types/info/music/v0.1.0
|
|
&tent_post_types=https://tent.io/types/posts/status/v0.1.0,https://tent.io/types/posts/photo/v0.1.0
|
|
</pre>
|
|
</div>
|
|
|
|
<h5>Parameters</h5>
|
|
<table class="table table-striped table-bordered">
|
|
<thead >
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody >
|
|
<tr>
|
|
<td><code>client_id</code></td>
|
|
<td>Required</td>
|
|
<td>The <code>id</code> obtained by registering with the Tent server</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>redirect_uri</code></td>
|
|
<td>Required</td>
|
|
<td>The URI to redirect to after authentication is complete. It must <strong>exactly</strong> match a URI (including parameters) provided during app registration in <code>redirect_uris</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>state</code></td>
|
|
<td>Optional</td>
|
|
<td>This parameter will be added to the <code>redirect_uri</code> and should always be set to a random string that is stored in the session, and then verified to prevent cross-site request forgery attacks.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>scope</code></td>
|
|
<td>Optional</td>
|
|
<td>A comma-separated list of scopes that the app is requesting access to.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>tent_profile_info_types</code></td>
|
|
<td>Optional</td>
|
|
<td>A comma-separated list of profile info type urls that the app is requesting access to. Set to <code>all</code> to request full access to the profile.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>tent_post_types</code></td>
|
|
<td>Optional</td>
|
|
<td>A comma-separated list of type urls that the app is requesting access to. Set to <code>all</code> to request access to all posts.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>tent_notification_url</code></td>
|
|
<td>Optional</td>
|
|
<td>The URI to send post notifications to.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h5>Scopes</h5>
|
|
<table class="table table-striped table-bordered">
|
|
<thead >
|
|
<tr>
|
|
<th>Scope</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody >
|
|
<tr>
|
|
<td><code>read_profile</code></td>
|
|
<td>Read profile sections listed in the <code>profile_info</code> parameter</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>write_profile</code></td>
|
|
<td>Read and write profile sections listed in the <code>profile_info</code> parameter</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>read_followers</code></td>
|
|
<td>Read follower list</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>write_followers</code></td>
|
|
<td>Read follower list and block followers</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>read_followings</code></td>
|
|
<td>Read followings list</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>write_followings</code></td>
|
|
<td>Read followings list and follow new entities</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>read_posts</code></td>
|
|
<td>Read posts with types listed in the <code>post_types</code> parameter</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>write_posts</code></td>
|
|
<td>Read and publish posts with types listed in the <code>post_types</code> parameter</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h4>Redirect</h4>
|
|
|
|
<p>After the user has authorized the application, the Tent server will redirect the
|
|
User-Agent back to the specified <code>redirect_uri</code> with a <code>code</code> that can be used
|
|
to retrieve authentication details from the server.</p>
|
|
|
|
<p>The <code>state</code> parameter should be matched against the <code>state</code> parameter sent in
|
|
the initial request to prevent request forgery.</p>
|
|
<div class="highlight"><pre>HTTP/1.1 302 Found
|
|
Location: http://app.example.com/tent/callback?code=9a27c37c0adb08351b1e7aac4ec12dc6&state=87351cc2f6737bfc8ba
|
|
</pre>
|
|
</div>
|
|
|
|
<h4>Access Token</h4>
|
|
|
|
<p>The <code>code</code> must be traded for permanent authentication details that can be used
|
|
to access the Tent server on behalf of the user.</p>
|
|
|
|
<h5>POST /apps/:id/authorizations</h5>
|
|
|
|
<p>The request must be signed with a MAC using the secret obtained during app
|
|
registration. Currently only the <code>mac</code> <code>token_type</code> is supported.</p>
|
|
<div class="highlight"><pre>POST /apps/p0cq4m/authorizations HTTP/1.1
|
|
Content-Type: application/vnd.tent.v0+json
|
|
Accept: application/vnd.tent.v0+json
|
|
Authorization: MAC id="a:f665629b", ts="1346984266", nonce="1f400b", mac="9kvPu8d7eM0kT/19XjHC39FiOWJZyYHAqbD5cTjAAkc="
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre><span class="p">{</span>
|
|
<span class="nt">"code"</span><span class="p">:</span> <span class="s2">"9a27c37c0adb08351b1e7aac4ec12dc6"</span><span class="p">,</span>
|
|
<span class="nt">"token_type"</span><span class="p">:</span> <span class="s2">"mac"</span>
|
|
<span class="p">}</span>
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre>HTTP/1.1 200 OK
|
|
Content-Type: application/vnd.tent.v0+json
|
|
Content-Length: 124
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre><span class="p">{</span>
|
|
<span class="nt">"access_token"</span><span class="p">:</span> <span class="s2">"u:083dc7a9"</span><span class="p">,</span>
|
|
<span class="nt">"mac_key"</span><span class="p">:</span> <span class="s2">"b67e42ad66e10538785d6d1bca024a17"</span><span class="p">,</span>
|
|
<span class="nt">"mac_algorithm"</span><span class="p">:</span> <span class="s2">"hmac-sha-256"</span><span class="p">,</span>
|
|
<span class="nt">"token_type"</span><span class="p">:</span> <span class="s2">"mac"</span>
|
|
<span class="p">}</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<h5>Response Parameters</h5>
|
|
<table class="table table-striped table-bordered">
|
|
<thead >
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody >
|
|
<tr>
|
|
<td><code>access_token</code></td>
|
|
<td>Used as the MAC key identifier.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mac_key</code></td>
|
|
<td>Used as the MAC key for requests.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>mac_algorithm</code></td>
|
|
<td>The MAC algorithm to be used.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>token_type</code></td>
|
|
<td>Specifies the token type. Currently always <code>mac</code></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h3>Request Authentication</h3>
|
|
|
|
<p>Tent uses <a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01">HTTP MAC Access
|
|
Authentication</a> to
|
|
authenticate app requests. Requests to modify the app's registration details
|
|
must be authorized using the provided <code>id</code> and <code>secret</code> as the
|
|
MAC key identifier and MAC key respectively.</p>
|
|
|
|
<p>Requests to the Tent server on behalf of an authenticated user must be
|
|
authorized using the credentials retrieved at the end of the auth flow.
|
|
The <code>access_token</code> and <code>mac_key</code> are the MAC key identifier and MAC key
|
|
respectively.</p>
|
|
|
|
<h3>App Registration Modification</h3>
|
|
|
|
<p>The request must be authenticated with a MAC generated using the secret from the
|
|
initial registration.</p>
|
|
|
|
<h4>GET /apps/:id</h4>
|
|
<div class="highlight"><pre>GET /apps/p0cq4m HTTP/1.1
|
|
Accept: application/vnd.tent.v0+json
|
|
Authorization: MAC id="a:f665629b", ts="1346984266", nonce="173d55", mac="lXyfBqkxNmZZ83f5brd1dlgm6V0ZQjkSCSwjnR5U6Fo="
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre>HTTP/1.1 200 OK
|
|
Content-Type: application/vnd.tent.v0+json
|
|
Last-Modified: Fri, 07 Sep 2012 02:17:46 GMT
|
|
Content-Length: 853
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre><span class="p">{</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"FooApp"</span><span class="p">,</span>
|
|
<span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Does amazing foos with your data"</span><span class="p">,</span>
|
|
<span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://example.com"</span><span class="p">,</span>
|
|
<span class="nt">"icon"</span><span class="p">:</span> <span class="s2">"http://example.com/icon.png"</span><span class="p">,</span>
|
|
<span class="nt">"redirect_uris"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://app.example.com/tent/callback"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"scopes"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"write_profile"</span><span class="p">:</span> <span class="s2">"Uses an app profile section to describe foos"</span><span class="p">,</span>
|
|
<span class="nt">"read_followings"</span><span class="p">:</span> <span class="s2">"Calculates foos based on your followings"</span>
|
|
<span class="p">},</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"p0cq4m"</span><span class="p">,</span>
|
|
<span class="nt">"authorizations"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"post_types"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://tent.io/types/post/status/v0.1.0"</span><span class="p">,</span>
|
|
<span class="s2">"https://tent.io/types/post/photo/v0.1.0"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"profile_info_types"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://tent.io/types/info/basic/v0.1.0"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"scopes"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"read_posts"</span><span class="p">,</span>
|
|
<span class="s2">"write_posts"</span><span class="p">,</span>
|
|
<span class="s2">"import_posts"</span><span class="p">,</span>
|
|
<span class="s2">"read_profile"</span><span class="p">,</span>
|
|
<span class="s2">"write_profile"</span><span class="p">,</span>
|
|
<span class="s2">"read_followers"</span><span class="p">,</span>
|
|
<span class="s2">"write_followers"</span><span class="p">,</span>
|
|
<span class="s2">"read_followings"</span><span class="p">,</span>
|
|
<span class="s2">"write_followings"</span><span class="p">,</span>
|
|
<span class="s2">"read_groups"</span><span class="p">,</span>
|
|
<span class="s2">"write_groups"</span><span class="p">,</span>
|
|
<span class="s2">"read_permissions"</span><span class="p">,</span>
|
|
<span class="s2">"write_permissions"</span><span class="p">,</span>
|
|
<span class="s2">"read_apps"</span><span class="p">,</span>
|
|
<span class="s2">"write_apps"</span><span class="p">,</span>
|
|
<span class="s2">"follow_ui"</span><span class="p">,</span>
|
|
<span class="s2">"read_secrets"</span><span class="p">,</span>
|
|
<span class="s2">"write_secrets"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"notification_url"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"ha4g6i"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
<span class="p">}</span>
|
|
</pre>
|
|
</div>
|
|
|
|
<h4>PUT /apps/:id</h4>
|
|
<div class="highlight"><pre>PUT /apps/p0cq4m HTTP/1.1
|
|
Content-Type: application/vnd.tent.v0+json
|
|
Accept: application/vnd.tent.v0+json
|
|
Authorization: MAC id="a:f665629b", ts="1346984266", nonce="722389", mac="X0okwuXuknoB+FjbVS02LzIvL4dmYDHlnkSjwmmpBMg="
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre><span class="p">{</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"FooApp"</span><span class="p">,</span>
|
|
<span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Does amazing foos with your data"</span><span class="p">,</span>
|
|
<span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://example.com"</span><span class="p">,</span>
|
|
<span class="nt">"icon"</span><span class="p">:</span> <span class="s2">"http://example.com/icon.png"</span><span class="p">,</span>
|
|
<span class="nt">"redirect_uris"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://app.example.com/tent/callback"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"scopes"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"write_profile"</span><span class="p">:</span> <span class="s2">"Uses an app profile section to describe foos"</span><span class="p">,</span>
|
|
<span class="nt">"read_followings"</span><span class="p">:</span> <span class="s2">"Calculates foos based on your followings"</span><span class="p">,</span>
|
|
<span class="nt">"write_following"</span><span class="p">:</span> <span class="s2">"Follow new users when you click"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre>HTTP/1.1 200 OK
|
|
Content-Type: application/vnd.tent.v0+json
|
|
Content-Length: 905
|
|
</pre>
|
|
</div>
|
|
<div class="highlight"><pre><span class="p">{</span>
|
|
<span class="nt">"name"</span><span class="p">:</span> <span class="s2">"FooApp"</span><span class="p">,</span>
|
|
<span class="nt">"description"</span><span class="p">:</span> <span class="s2">"Does amazing foos with your data"</span><span class="p">,</span>
|
|
<span class="nt">"url"</span><span class="p">:</span> <span class="s2">"http://example.com"</span><span class="p">,</span>
|
|
<span class="nt">"icon"</span><span class="p">:</span> <span class="s2">"http://example.com/icon.png"</span><span class="p">,</span>
|
|
<span class="nt">"redirect_uris"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://app.example.com/tent/callback"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"scopes"</span><span class="p">:</span> <span class="p">{</span>
|
|
<span class="nt">"write_profile"</span><span class="p">:</span> <span class="s2">"Uses an app profile section to describe foos"</span><span class="p">,</span>
|
|
<span class="nt">"read_followings"</span><span class="p">:</span> <span class="s2">"Calculates foos based on your followings"</span><span class="p">,</span>
|
|
<span class="nt">"write_following"</span><span class="p">:</span> <span class="s2">"Follow new users when you click"</span>
|
|
<span class="p">},</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"p0cq4m"</span><span class="p">,</span>
|
|
<span class="nt">"authorizations"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="p">{</span>
|
|
<span class="nt">"post_types"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://tent.io/types/post/status/v0.1.0"</span><span class="p">,</span>
|
|
<span class="s2">"https://tent.io/types/post/photo/v0.1.0"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"profile_info_types"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"https://tent.io/types/info/basic/v0.1.0"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"scopes"</span><span class="p">:</span> <span class="p">[</span>
|
|
<span class="s2">"read_posts"</span><span class="p">,</span>
|
|
<span class="s2">"write_posts"</span><span class="p">,</span>
|
|
<span class="s2">"import_posts"</span><span class="p">,</span>
|
|
<span class="s2">"read_profile"</span><span class="p">,</span>
|
|
<span class="s2">"write_profile"</span><span class="p">,</span>
|
|
<span class="s2">"read_followers"</span><span class="p">,</span>
|
|
<span class="s2">"write_followers"</span><span class="p">,</span>
|
|
<span class="s2">"read_followings"</span><span class="p">,</span>
|
|
<span class="s2">"write_followings"</span><span class="p">,</span>
|
|
<span class="s2">"read_groups"</span><span class="p">,</span>
|
|
<span class="s2">"write_groups"</span><span class="p">,</span>
|
|
<span class="s2">"read_permissions"</span><span class="p">,</span>
|
|
<span class="s2">"write_permissions"</span><span class="p">,</span>
|
|
<span class="s2">"read_apps"</span><span class="p">,</span>
|
|
<span class="s2">"write_apps"</span><span class="p">,</span>
|
|
<span class="s2">"follow_ui"</span><span class="p">,</span>
|
|
<span class="s2">"read_secrets"</span><span class="p">,</span>
|
|
<span class="s2">"write_secrets"</span>
|
|
<span class="p">],</span>
|
|
<span class="nt">"notification_url"</span><span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
|
|
<span class="nt">"id"</span><span class="p">:</span> <span class="s2">"ha4g6i"</span>
|
|
<span class="p">}</span>
|
|
<span class="p">]</span>
|
|
<span class="p">}</span>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><footer>© 2012 Apollic Software, LLC</footer></body>
|
|
</html> |