jmapio / jmapio/jmap

Document authentication discovery on top of JMAP

Open
#353 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
1.4k
Forks
100
Avg merge
18h 7m
Merged PRs (30d)
2

Description

Issue

Authentication discovery is a major interoperability concern on top of JMAP, thus defeating the inter-operability goal of JMAP, turning this standard merely into the webMail industry best practice.

As a third-party client, I have no prior knowledge of the authentication schemes supported by the JMAP server. As a third-party client, I need a way to discover supported authentication scheme (to ease end user configuration options).

Standards that solves this issue

Luckily, RFC-2617 (https://tools.ietf.org/html/rfc2617#section-3.2.1) about HTTP authentication introduce such a mechanism through WWW-Authenticate header. A failed 401 authentication would result in this header being positioned, allowing discovery for the client of the supported authentication mechanisms. The client can then set up the authentication mechanism it supports and prefer, without requiring user input.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate further

RFC-7235 updates RFC-2617 (https://tools.ietf.org/html/rfc7235#section-4.1)

   A server generating a 401 (Unauthorized) response MUST send a
   WWW-Authenticate header field containing at least one challenge. 

So far JMAP implementation do not emntionWWW-Authenticate header field.

Here is an example of multi-challenge WWW-Authenticate header (RFC-7235):

WWW-Authenticate: Newauth realm="apps", type=1,  title="Login to \"apps\"", Basic realm="simple"

Please note that this header also can be used, if desired, to give hints toward why auth failed... Example (https://tools.ietf.org/html/rfc6750#section-3):

     HTTP/1.1 401 Unauthorized
     WWW-Authenticate: Bearer realm="example",
                       error="invalid_token",
                       error_description="The access token expired"

A full list of standard auth shemes is available here: http://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml

Sadly, RFC-8620 do not mention the existence of RFC-7235 nor the existence of WWW-Authenticate header.

Proposal

My true feeling is that the above mentioned best practices needs at least to be documented, at most mandated.

  • Update jmap.io server guide to advise positionning WWW-Authenticate header.
  • Update jmap.io client guide to mention the use of WWW-Authenticate header as an auto-discovery mechanism - and maybe also include also advises and step toward session discovery?
  • Perform an errata of RFC8620 (JMAP core) to mention this mechanism (MUST)

Also, connecting James with LTT.RS I got lucky that we had an authentication mechanism in common... Maybe some common ground needs to be find here too?

  • Advise a standard mechanism: Basic auth ? (I know it brings security concerns but is there something more generic?)

Related links

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the JMAP server and client guides on jmap.io and the authentication sections of RFC 8620, then compare them with RFC 7235's WWW-Authenticate requirements. Document the client discovery guidance and determine whether the RFC errata or a normative requirement is in scope; done means the agreed guidance is reflected in the relevant documentation.

Written by the indexing model from the issue text.

Assessment

Domain
api, authentication, documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.