<blockquote>
<p>a failure to persist the access token properly is not an issue with the rails port but an issue with the apps.</p>
</blockquote>
<p>I think what <a href="https://github.com/Zverik" class="user-mention">@Zverik</a> is saying is not that the access token would be shared via the API, but that the user would accept a list of permissions on a per-app basis rather than a per-device / per-access-token basis. Accepting (or rejecting) a set of permissions is a part of the OAuth flow that we added, so we are able to skip that step if the user has previously authorised a token for this same app, and (I think) without impacting the security properties of OAuth.</p>
<p>Effectively, this would have two parts:</p>
<ol>
<li>Where we currently <a href="https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/application_controller.rb#L53-L68">check token capability</a>, we would instead look up a new type (say, <code>ClientPermissions</code>) which is unique per-user and per-<code>client_application</code>.</li>
<li>When authorising a new token, if a <code>ClientPermissions</code> object exists for the (<code>user</code>, <code>client_application</code>) pair, then use that instead of asking the user to approve the permissions.</li>
</ol>
<p>The token UI would then be able to edit the <code>ClientPermissions</code> objects. This would mean the user loses the ability that they currently have to grant different permissions to different instances of the same app. I'm not sure if anyone is using that ability, so perhaps not a big loss.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/1455#issuecomment-281975878">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLdgu3rbUpDE8c6rJv0DwMrVcsy-bks5rfXdQgaJpZM4MIYe0">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLdxNf6uYyCn6Px4wdOBq2TubM79_ks5rfXdQgaJpZM4MIYe0.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/openstreetmap/openstreetmap-website/issues/1455#issuecomment-281975878"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"PERSON","message":"@zerebubuth in #1455: \u003e a failure to persist the access token properly is not an issue with the rails port but an issue with the apps.\r\n\r\nI think what @Zverik is saying is not that the access token would be shared via the API, but that the user would accept a list of permissions on a per-app basis rather than a per-device / per-access-token basis. Accepting (or rejecting) a set of permissions is a part of the OAuth flow that we added, so we are able to skip that step if the user has previously authorised a token for this same app, and (I think) without impacting the security properties of OAuth.\r\n\r\nEffectively, this would have two parts:\r\n\r\n1. Where we currently [check token capability](https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/application_controller.rb#L53-L68), we would instead look up a new type (say, `ClientPermissions`) which is unique per-user and per-`client_application`.\r\n2. When authorising a new token, if a `ClientPermissions` object exists for the (`user`, `client_application`) pair, then use that instead of asking the user to approve the permissions.\r\n\r\nThe token UI would then be able to edit the `ClientPermissions` objects. This would mean the user loses the ability that they currently have to grant different permissions to different instances of the same app. I'm not sure if anyone is using that ability, so perhaps not a big loss."}],"action":{"name":"View Issue","url":"https://github.com/openstreetmap/openstreetmap-website/issues/1455#issuecomment-281975878"}}}</script>