Story #4919

[API] Arvados clients can use standard OAuth2 protocol instead of custom token handling mechanism

Added by Peter Amstutz about 4 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Story points:
2.0

Description

While the API server uses OAuth2 to authenticate with the SSO server, Workbench does not use OAuth2 to authenticate with SSO directly, but instead follows a custom login flow that authenticates the user on API server with SSO, and then returns an API server token to workbench via a query parameter in a redirect URL.

https://tools.ietf.org/html/rfc6750 section 5.3:

Don't pass bearer tokens in page URLs: Bearer tokens SHOULD NOT be
passed in page URLs (for example, as query string parameters).
Instead, bearer tokens SHOULD be passed in HTTP message headers or
message bodies for which confidentiality measures are taken.
Browsers, web servers, and other software may not adequately
secure URLs in the browser history, web server logs, and other
data structures. If bearer tokens are passed in page URLs,
attackers might be able to steal them from the history data, logs,
or other unsecured locations.

Also, section 2.1:

OAuth2 specifies that the Authorization header using access tokens is "Authorization: Bearer XYZ" ( not "Authorization: OAuth2 XYZ" (which we use now)

History

#1 Updated by Peter Amstutz about 4 years ago

Proposed flow for workbench:

  1. Workbench login button sends browser directly to SSO for sign in (no redirects via API server)
  2. SSO server performs log in, and redirects the user back to workbench with authorization code
  3. Workbench gets browser request with authorization code
    1. Workbench sends login request with authorization code to API server
  4. API server gets workbench request with authorization code
    1. API server sends authorization code to SSO for validation
  5. SSO gets request with authorization code from API
    1. SSO validates user identity and responds to API
  6. API gets response from SSO
    1. API server finds/creates user for associated SSO
    2. API server creates new API token and responds to workbench
  7. Workbench gets API token and puts it in the browser session
    1. Respond to browser by loading the desired page

#2 Updated by Peter Amstutz about 4 years ago

Proposed flow for browser based apps that talk to API server directly:

  1. Login button sends browser directly to SSO for sign in (no redirects via API server)
  2. SSO server performs log in, and redirects the user back to browser app with authorization code
  3. Browser app sends login request with authorization code to API server
  4. API server gets browser app request with authorization code
    1. API server sends authorization code to SSO for validation
  5. SSO gets request with authorization code from API
    1. SSO validates user identity and responds to API
  6. API gets response from SSO
    1. API server finds/creates user for associated SSO
    2. API server creates new API token and responds to browser app
  7. Browser app gets API token and possibly puts it in local storage
    1. Browser proceeds to use API token to communicate with API server directly

#3 Updated by Peter Amstutz about 4 years ago

  • Subject changed from Workbench uses OAuth2 instead of custom login flow to Arvados web apps use OAuth2 instead of custom login flow

#4 Updated by Peter Amstutz about 4 years ago

  • Description updated (diff)

#5 Updated by Peter Amstutz about 4 years ago

Also, OAuth2 specifies that the Authorization header using access tokens is "Authorization: Bearer XYZ" (https://tools.ietf.org/html/rfc6750) not "Authorization: OAuth2 XYZ" (which we use now)

#6 Updated by Peter Amstutz about 4 years ago

  • Description updated (diff)

#7 Updated by Peter Amstutz about 4 years ago

  • Description updated (diff)

#8 Updated by Peter Amstutz about 4 years ago

  • Description updated (diff)

#9 Updated by Tom Clegg almost 4 years ago

  • Subject changed from Arvados web apps use OAuth2 instead of custom login flow to [API] Arvados clients can use standard OAuth2 protocol instead of custom token handling mechanism
  • Story points set to 2.0

#10 Updated by Tom Clegg almost 4 years ago

  • Target version set to Arvados Future Sprints

Also available in: Atom PDF