<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
  <!ENTITY rfc3986 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3986.xml">
]>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-jones-on-behalf-of-jwt-00"
     ipr="trust200902">
  <front>
    <title abbrev="On-behalf-of for JWTs">On-Behalf-Of Semantics for JSON Web Tokens (JWTs)</title>

    <author fullname="Michael B. Jones (Editor)" initials="M.B." surname="Jones (editor)">
      <organization>Microsoft</organization>
    </author>

    <author fullname="Yaron Y. Goland" initials="Y.Y." surname="Goland">
      <organization>Microsoft</organization>
    </author>

    <date day="26" month="October" year="2010" />

    <area>Applications</area>

    <keyword>RFC</keyword>

    <keyword>Request for Comments</keyword>

    <keyword>I-D</keyword>

    <keyword>Internet-Draft</keyword>

    <keyword>JSON Web Token</keyword>

    <keyword>JWT</keyword>

    <keyword>Delegation</keyword>

    <keyword>On-behalf-of</keyword>

    <keyword>act as</keyword>
    
    <abstract>
      <t>
        This specification defines how to express the claim that one
        principal is allowed to act on behalf of another principal in
        a defined context using <xref target="JWT">JSON Web Tokens
        (JWTs)</xref>.
      </t>
    </abstract>

    <note title="Requirements Language">
      <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.
      </t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>
        This specification defines how to express the claim that one
        principal is allowed to act on behalf of another principal in
        a defined context using <xref target="JWT">JSON Web Tokens
        (JWTs)</xref>.
      </t>
      <figure>
        <artwork>
<![CDATA[{
 "obo":
 {
  "prn":"mailto:joe@example.com",
  "ctx":["urn:adatum.com:calendar"]
 }
}]]>
        </artwork>
      </figure>
      <t>
        In this example, the "obo" (on-behalf-of) claim would be
        included in a JWT's claims section. The claim states that the
        holder of the bearer token has the right to act on behalf of
        the principal mailto:joe@example.com in the context of the
        service type urn:adatum.com:calendar.
      </t>
    </section>

    <section title="On-Behalf-Of vs. Impersonation Semantics">
      <t>
        When principal A acts on behalf of principal B, A is given all
        the rights that B has within some defined rights context. With
        on-behalf-of semantics, principal A still has its own identity
        separate from B and it is explicitly understood that while B
        may have delegated its rights to A, any actions taken are
        being taken by A and not B. In a sense, A is an agent for B.
      </t>
      <t>
        On-behalf-of semantics are therefore different than
        impersonation semantics, with which it is sometimes
        confused. When principal A impersonates principal B, then in
        so far as any entity receiving claims is concerned, they are
        actually dealing with B. It is true that some members of the
        identity system might have awareness that impersonation is
        going on but it is not a requirement. For all intents and
        purposes, A is B.
      </t>
    </section>

    <section title="on-behalf-of claims">
      <t>
        An on-behalf-of claim made in a JWT consists of a child member
        of the root JSON object with the member name "obo"
        (on-behalf-of). The "obo" claim MUST contain the two child
        members, "prn" (principal) and "ctx" (context). "obo" MAY
        contain other child members.
      </t>
      <t>
        If a JWT processor receives an "obo" claim with an
        unrecognized child member, then this means the "obo" claim is
        invalid and unless separate semantics have been applied, an
        invalid "obo" claim MUST cause the entire JWT to be rejected
        for processing.
      </t>
      <t>
        The "prn" (principal) child member MUST have a value that is a
        URI (as defined in <xref target="RFC3986">RFC 3986</xref>).
        The semantics of this URI is that it identifies the principal
        for whom the bearer of the JWT is acting on behalf of.
      </t>
      <t>
        The "ctx" (context) child member MUST have a value that is an
        array of strings, each of which MUST be a URI. All "ctx" value
        arrays MUST contain at least one URI. The members of the array
        define permission contexts in which the bearer is allowed to
        act on behalf of the principal. The definition of these
        contexts is outside the scope of this specification.
      </t>
      <t>
        There is not necessarily a conflict between including an "obo"
        claim along with claims about the identity of the bearer of
        the token.  The former provides a right - the later
        information about the identity of the principal that can
        exercise that right.
      </t>
      <t>
        However, as with any claims, the relationship between "obo"
        and other claims is not defined implicitly. Rather an explicit
        definition must be provided in order for the combined
        semantics to be understood.
      </t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>
        The claim "obo" is to be registered in the JWT JSON Web Token
        Claims registry as defined in the <xref
        target="JWT">JWT</xref> specification.
      </t>

    </section>

    <section anchor="Security" title="Security Considerations">
      <t>
        All of the normal security issues, especially in relationship
        to comparing URIs and dealing with unrecognized values, that
        are discussed in <xref target="JWT">JWT</xref> also apply
        here.
      </t>
      <t>
        In addition, on-behalf-of introduces its own unique security
        issues. Any time one principal is delegated the rights of
        another principal, the potential for abuse is always a
        concern. That is why the "ctx" (context) member is mandatory
        and must contain at least one value. The context values
        restrict the contexts in which the delegated rights are to be
        exercised. The specification explicitly precludes omitting the
        "ctx" member in order to ensure that there is always some
        context by which the delegated rights are constrained.
      </t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &rfc2119;
      &rfc3986;

      <reference anchor="JWT">
        <front>
          <title>JSON Web Token (JWT)</title>

          <author fullname="Michael B. Jones (Editor)" initials="M.B." surname="Jones (editor)">
            <organization>Microsoft</organization>
          </author>

          <author fullname="Dirk Balfanz" initials="D. " surname="Balfanz">
            <organization>Google</organization>
          </author>

          <author fullname="John Bradley" initials="J." surname="Bradley">
            <organization>independent</organization>
          </author>

          <author fullname="Yaron Y. Goland" initials="Y.Y." surname="Goland">
            <organization>Microsoft</organization>
          </author>

          <author fullname="John Panzer" initials="J. " surname="Panzer">
            <organization>Google</organization>
          </author>

          <author fullname="Nat Sakimura" initials="N. " surname="Sakimura">
            <organization>Nomura Research Institute</organization>
          </author>

          <date day="25" month="October" year="2010" />
        </front>
        <format target="http://self-issued.info/docs/draft-jones-json-web-token-00.html" type="HTML"/>
      </reference>

    </references>
  </back>
</rfc>
