<?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-07" 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="05"/>

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

    <abstract>


<?line 34?>

<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 38?>

<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>

</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. The server MUST use the application server key 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 signed 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='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>





  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA6VZ0XbbuBF951dMlYe1eyRF1iZOotPTVrWdrrqJ7UbKbvct
EDESsSEBFgClZXN8Tn+jb/2Wfkq/pGcGIEVa8m57mpdIFDEY3LlzZwYejUaJ
Vz7HGQw+OgSzge/m94trUBr+9H5+D9/j+r5y2SCRJr0VBb0nrdj4kUK/Gf1Y
iHK0x3VZuWy0E6WSo8mrQSKFxxlMJ9OXo8nFaPIySYRFMYOF9mg1+mS/nbH5
xFXrQjmnjPZ1iTNY3KzeJqnwM3BeJqq0Mxh4Wzk/nUzeTKaDJBGVz4ydJTBK
ADR7dC20whz+WOXepVkCgIVQ+QwkP//9NjwfS0wSbWwhvNrhLAF4u7hfXry+
pI8ADQrXaqu8yGGptlr4yiIsvdBSWAln18vl+YDfbr3gfyMwdjuDwa3wymiR
w0I7r3zlGdBmvQOhJawwzbTJzbaGs9vFchUNNpBdfD2avAoOCbtFP4NB5n3p
Zs+fS6PGxm6fX0zGl5Pp6+e0ekxn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