<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.21 (Ruby 3.3.6) -->


<!DOCTYPE rfc  [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">

<!ENTITY RFC8620 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8620.xml">
<!ENTITY RFC8030 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8030.xml">
<!ENTITY RFC8292 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8292.xml">
<!ENTITY RFC2119 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC7515 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml">
]>


<rfc ipr="trust200902" docName="draft-ietf-jmap-webpush-vapid-09" category="std" consensus="true" submissionType="IETF">
  <front>
    <title>Use of VAPID in JMAP WebPush</title>

    <author initials="D." surname="Gultsch" fullname="Daniel Gultsch">
      <organization></organization>
      <address>
        <email>daniel@gultsch.de</email>
      </address>
    </author>

    <date year="2025" month="January" day="07"/>

    <area>Internet</area>
    <workgroup>JMAP</workgroup>
    

    <abstract>


<?line 45?>

<t>This document defines a method for JMAP servers to advertise their capability to authenticate WebPush notifications using the Voluntary Application Server Identification protocol.</t>



    </abstract>



  </front>

  <middle>


<?line 49?>

<section anchor="introduction"><name>Introduction</name>

<t>JMAP <xref target="RFC8620"/> specifies how clients can subscribe to events using a protocol that is compatible with WebPush <xref target="RFC8030"/>. Some push services require that the application server authenticates all push messages using the Voluntary Application Server Identification protocol <xref target="RFC8292"/>. To facilitate that, the client (or user agent in WebPush terminology) needs the VAPID public key of the application server to pass it along to the push service when retrieving a new endpoint.</t>

</section>
<section anchor="conventions-used-in-this-document"><name>Conventions Used in This Document</name>

<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.
These words may also appear in this document in
lower case as plain English words, absent their normative meanings.
<?line -8?></t>

</section>
<section anchor="discovering-support-for-vapid"><name>Discovering Support for VAPID</name>

<t>The JMAP capabilities object is returned as part of the standard JMAP session object (see Section 2 of <xref target="RFC8620"/>). Servers supporting this specification MUST add a property called "urn:ietf:params:jmap:webpush-vapid" to the capabilities object. The value of this property is an object that MUST contain the following information:</t>

<t><list style="symbols">
  <t>applicationServerKey: "String"  <vspace blankLines='1'/>
The ECDSA public key (current systems use the P-256 curve) <xref target="FIPS186"/>, in its uncompressed form as described in <xref target="X9.62"/> Annex A and encoded using base64url encoding <xref target="RFC7515"/>, that the push service will use to authenticate the application server.</t>
</list></t>

<t>Informative Note: The format of the application server key was chosen to ensure compatibility with the browser API (<xref target="PUSH-API"/>, Section 7.2), allowing the key to be directly copied and used without additional transformation. Additionally, as noted in <xref target="RFC8292"/>, Section 3.2, the X9.62 encoding simplifies key comparisons and is more compact than alternative formats.</t>

</section>
<section anchor="issuing-push-notifications"><name>Issuing Push Notifications</name>

<t>Every time the server sends a push message to a PushSubscription URL it MUST authenticate the POST request using the protocol outlined in <xref target="RFC8292"/>. This includes both StateChange events and PushVerification notifications. To authenticate the request, the server MUST use a JWT signed by the private key corresponding to the application server key. This application server key MUST be the one that was advertised in the capabilities object at the time the PushSubscription was created.</t>

</section>
<section anchor="key-rotation"><name>Key Rotation</name>

<t>When a server needs to replace its VAPID key, it MUST update the sessionState per <xref target="RFC8620"/>. The client MUST monitor the JMAP session object for changes to the VAPID key and MUST recreate its push subscription after detecting such a change.</t>

<t>After key rotation, the server MAY continue to send push notifications for existing push subscriptions using the old application server key for a transitional period. This allows clients time to recreate their respective push subscriptions. After the transitional period (or immediately for implementations that do not have one), the server MUST destroy push subscriptions that use the old key.</t>

<t>When destroying push subscriptions that include the data type <spanx style="verb">PushSubscription</spanx>, the server MAY issue one final StateChange push notification using the old URL and application server key to notify the client of changes to the PushSubscription data type. This prompts the client to make a <spanx style="verb">PushSubscription/changes</spanx> method call. The response to this call will contain an updated sessionState, which refers to a session object that contains the new VAPID key.</t>

<t>A race condition can occur when the server updates its VAPID key after the client has refreshed the session object but before calling the PushSubscription/set method. This situation causes the server to send a PushVerification object to a push resource URL that is now associated with an outdated VAPID key. Consequently, the push service will reject the PushVerification with a 403 (Forbidden) status code, as specified in <xref target="RFC8292"/>.</t>

<t>To alleviate this problem, the client MUST check if the sessionState in the response from the PushSubscription/set method points to a session object with an applicationServerKey that matches their expectations. If there is a mismatch, the client MAY retry creating the PushSubscription. Additionally, the client MAY destroy the PushSubscription from the earlier, failed attempt.</t>

</section>
<section anchor="security-considerations"><name>Security Considerations</name>

<t>During the key rotation process, synchronization issues between the client and server may arise. Specifically, a client might restrict a push subscription with the push service to an outdated key, while the server sends the PushVerification object authenticated with the newly rotated key. This mismatch leads to the push service rejecting the PushVerification request with HTTP status code 403, as specified in <xref target="RFC8292"/>, Section 4.2.</t>

<t>Per the requirements of <xref target="RFC8620"/>, Section 7.2, the server MUST NOT retry the rejected PushVerification request. Consequently, the PushVerification object will not be delivered to the client.</t>

<t>To mitigate such issues, the client is responsible for detecting and resolving any synchronization discrepancies, as outlined in the 'Key Rotation' section of this document.</t>

<t>The inclusion of the <spanx style="verb">urn:ietf:params:jmap:webpush-vapid</spanx> property in the JMAP capabilities object is limited to providing information about the server's support for Voluntary Application Server Identification (VAPID). This property does not reveal sensitive information, nor does it introduce new security or privacy risks beyond those inherent to JMAP and WebPush. The security considerations for JMAP (<xref target="RFC8620"/>, especially Section 8.6 and Section 8.7 of that document), WebPush (<xref target="RFC8030"/>) and VAPID (<xref target="RFC8292"/>) apply to this document.</t>

</section>
<section anchor="iana-considerations"><name>IANA Considerations</name>

<section anchor="registration-of-the-jmap-capability-for-vapid"><name>Registration of the JMAP Capability for VAPID</name>

<t>This specification requests IANA to register a new capability in the JMAP Capabilities registry with the following data:</t>

<t>Capability Name: <spanx style="verb">urn:ietf:params:jmap:webpush-vapid</spanx></t>

<t>Specification document: this document</t>

<t>Intended use: common</t>

<t>Change Controller: IETF</t>

<t>Security and privacy considerations: this document, Section 6</t>

</section>
</section>


  </middle>

  <back>


<references title='References' anchor="sec-combined-references">

    <references title='Normative References' anchor="sec-normative-references">

<reference anchor="FIPS186" target="https://doi.org/10.6028/NIST.FIPS.186-4">
  <front>
    <title>Digital Signature Standard (DSS)</title>
    <author >
      <organization>National Institute of Standards and Technology (NIST)</organization>
    </author>
    <date year="2013" month="July"/>
  </front>
  <seriesInfo name="FIPS" value="186-4"/>
</reference>
<reference anchor="X9.62" >
  <front>
    <title>Public Key Cryptography for the Financial Services Industry: The Elliptic Curve Digital Signature Algorithm (ECDSA)</title>
    <author >
      <organization>American National Standards Institute</organization>
    </author>
    <date year="2005" month="November"/>
  </front>
  <seriesInfo name="ANSI" value="X9.62-2005"/>
</reference>
&RFC8620;
&RFC8030;
&RFC8292;
&RFC2119;
&RFC8174;
&RFC7515;


    </references>

    <references title='Informative References' anchor="sec-informative-references">

<reference anchor="PUSH-API" target="https://www.w3.org/TR/push-api/">
  <front>
    <title>Push API</title>
    <author initials="" surname="Peter Beverloo">
      <organization></organization>
    </author>
    <author initials="" surname="Martin Thomson">
      <organization></organization>
    </author>
    <author initials="" surname="Marcos Caceres">
      <organization></organization>
    </author>
    <date year="2024" month="September"/>
  </front>
</reference>


    </references>

</references>



  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA6VZ0XbbuBF951dMlYe1eyxZVhwn0enpVms7jXYTR43k3e5b
IHIkYgMCLABKq/r4X/ot/bKeGYAUacm77em+rEwSwGDmzp07k36/n3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