<?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.2 (Ruby 3.0.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 RFC4648 SYSTEM "https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4648.xml">
]>


<rfc ipr="trust200902" docName="draft-ietf-jmap-webpush-vapid-03" 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="2024" month="August" day="06"/>

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

    <abstract>


<?line 17?>

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

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

<t>JMAP <xref target="RFC8620"/> specifies how clients can subscribe to events using a protocol that is compatible to 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 faciliate 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 P-256 public key that the push service will use to authenticate the application server, encoded in URL-safe base64 representation as defined in <xref target="RFC4648"/>.</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 that 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 capabilites 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 in accordance with <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, that 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 SHOULD 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 SHOULD 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>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 the JMAP Capability for VAPID 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>

</section>
</section>


  </middle>

  <back>


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

&RFC8620;
&RFC8030;
&RFC8292;
&RFC2119;
&RFC8174;
&RFC4648;


    </references>




  </back>

<!-- ##markdown-source:
H4sIAAAAAAAAA6VY23LjuBF951cgmhc7ZSkajeP1qFLZOLYn66xvsezZyttA
JGRhhwS4AGivamv/Zb8lX5bTDZAiLTv7kIepkUmg0X369OkGx+NxFnQo1VyM
HrwSdiU+n9xenAltxD+vTm7FD2p52/j1KCtsfi0rWlc4uQpjrcJq/GMl6/Gz
WtZYMn6StS7G0w9YKwMWzqazw/H0eDw9yjLplJyLCxOUMypkz49zNp/5Zllp
77U1YVNjz8X5/acsl2EufCgyXTucF1zjw2w6/TidjWCpCW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