{
  "type": "drawfather",
  "revision": 1,
  "title": "OAuth authorization code exchange",
  "seed": 42,
  "sketch": "handwritten",
  "canvas": {
    "width": 1236,
    "height": 1356,
    "background": "#fffdf7"
  },
  "version": 2,
  "elements": [
    {
      "id": "browser",
      "x": 96,
      "y": 180,
      "width": 220,
      "height": 1096,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "#ffe3a0",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "Browser",
      "fontSize": 20,
      "type": "rectangle",
      "roundness": 0.3
    },
    {
      "id": "app",
      "x": 516,
      "y": 180,
      "width": 220,
      "height": 1096,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "#d3e1f5",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "Application",
      "fontSize": 20,
      "type": "rectangle",
      "roundness": 0.3
    },
    {
      "id": "auth",
      "x": 936,
      "y": 180,
      "width": 220,
      "height": 1096,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "#d3e1f5",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "Identity provider",
      "fontSize": 20,
      "type": "rectangle",
      "roundness": 0.3
    },
    {
      "id": "df-title",
      "x": 64,
      "y": 48,
      "width": 760,
      "height": 74,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "OAuth authorization code exchange",
      "fontSize": 32,
      "type": "text",
      "align": "left"
    },
    {
      "id": "login",
      "type": "arrow",
      "from": {
        "elementId": "browser",
        "anchor": "auto",
        "port": [
          0.5,
          0.16423357664233576
        ]
      },
      "to": {
        "elementId": "app",
        "anchor": "auto",
        "port": [
          0.4636363636363636,
          0.16423357664233576
        ]
      },
      "strokeStyle": "solid",
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "endHead": "filled-triangle",
      "curve": 0,
      "text": "",
      "fontSize": 24
    },
    {
      "id": "authorize",
      "type": "arrow",
      "from": {
        "elementId": "app",
        "anchor": "auto",
        "port": [
          0.5363636363636364,
          0.28832116788321166
        ]
      },
      "to": {
        "elementId": "auth",
        "anchor": "auto",
        "port": [
          0.5,
          0.28832116788321166
        ]
      },
      "strokeStyle": "solid",
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "endHead": "filled-triangle",
      "curve": 0,
      "text": "",
      "fontSize": 24
    },
    {
      "id": "code",
      "type": "arrow",
      "from": {
        "elementId": "auth",
        "anchor": "auto",
        "port": [
          0.5,
          0.4124087591240876
        ]
      },
      "to": {
        "elementId": "app",
        "anchor": "auto",
        "port": [
          0.5363636363636364,
          0.4124087591240876
        ]
      },
      "strokeStyle": "dashed",
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "endHead": "arrow",
      "curve": 0,
      "text": "",
      "fontSize": 24
    },
    {
      "id": "token",
      "type": "arrow",
      "from": {
        "elementId": "app",
        "anchor": "auto",
        "port": [
          0.5363636363636364,
          0.5364963503649635
        ]
      },
      "to": {
        "elementId": "auth",
        "anchor": "auto",
        "port": [
          0.5,
          0.5364963503649635
        ]
      },
      "strokeStyle": "solid",
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "endHead": "filled-triangle",
      "curve": 0,
      "text": "",
      "fontSize": 24
    },
    {
      "id": "issued",
      "type": "arrow",
      "from": {
        "elementId": "auth",
        "anchor": "auto",
        "port": [
          0.5,
          0.6605839416058394
        ]
      },
      "to": {
        "elementId": "app",
        "anchor": "auto",
        "port": [
          0.5363636363636364,
          0.6605839416058394
        ]
      },
      "strokeStyle": "dashed",
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "endHead": "arrow",
      "curve": 0,
      "text": "",
      "fontSize": 24
    },
    {
      "id": "session",
      "type": "arrow",
      "from": {
        "elementId": "app",
        "anchor": "auto",
        "port": [
          0.4636363636363636,
          0.7846715328467153
        ]
      },
      "to": {
        "elementId": "browser",
        "anchor": "auto",
        "port": [
          0.5,
          0.7846715328467153
        ]
      },
      "strokeStyle": "dashed",
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "endHead": "arrow",
      "curve": 0,
      "text": "",
      "fontSize": 24
    },
    {
      "id": "df-label-428821350e9691491f61",
      "x": 356,
      "y": 301,
      "width": 120,
      "height": 47,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "1. Sign in",
      "fontSize": 18,
      "type": "text",
      "align": "center"
    },
    {
      "id": "df-label-4a2dbd905287e75a5d2b",
      "x": 774.713,
      "y": 437,
      "width": 122.57400000000001,
      "height": 47,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "2. Authorize",
      "fontSize": 18,
      "type": "text",
      "align": "center"
    },
    {
      "id": "df-label-5694d08a2e53ffcae0c3",
      "x": 739.901,
      "y": 573,
      "width": 192.198,
      "height": 47,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "3. Authorization code",
      "fontSize": 18,
      "type": "text",
      "align": "center"
    },
    {
      "id": "df-label-3c469e9d6c5875d37a43",
      "x": 721.307,
      "y": 709,
      "width": 229.38600000000002,
      "height": 47,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "4. Exchange code + PKCE",
      "fontSize": 18,
      "type": "text",
      "align": "center"
    },
    {
      "id": "df-label-c91a3cc769f870fddc83",
      "x": 760.988,
      "y": 845,
      "width": 150.024,
      "height": 47,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "5. Access token",
      "fontSize": 18,
      "type": "text",
      "align": "center"
    },
    {
      "id": "df-label-3f3af1ecebbd1410ab41",
      "x": 317.27299999999997,
      "y": 981,
      "width": 197.45400000000004,
      "height": 47,
      "stroke": "#252525",
      "strokeWidth": 2,
      "fill": "transparent",
      "fillStyle": "hachure",
      "roughness": 1.2,
      "text": "6. Session established",
      "fontSize": 18,
      "type": "text",
      "align": "center"
    },
    {
      "id": "df-seq-active-ab27b729d9cc4cb1c009",
      "x": 618,
      "y": 356,
      "width": 16,
      "height": 704,
      "stroke": "#252525",
      "strokeWidth": 1,
      "fill": "#d3e1f5",
      "fillStyle": "solid",
      "roughness": 1.2,
      "text": "",
      "fontSize": 24,
      "type": "rectangle",
      "roundness": 0
    }
  ],
  "model": {
    "kind": "architecture",
    "direction": "horizontal",
    "origin": {
      "source": "native"
    },
    "nodes": [
      {
        "id": "browser",
        "label": "Browser",
        "shape": "rectangle",
        "role": "generic",
        "notation": {
          "kind": "actor"
        }
      },
      {
        "id": "app",
        "label": "Application",
        "shape": "rectangle",
        "role": "generic",
        "notation": {
          "kind": "participant"
        }
      },
      {
        "id": "auth",
        "label": "Identity provider",
        "shape": "rectangle",
        "role": "generic",
        "notation": {
          "kind": "participant"
        }
      }
    ],
    "connections": [
      {
        "id": "login",
        "from": "browser",
        "to": "app",
        "role": "message",
        "label": "Sign in",
        "labelId": "df-label-428821350e9691491f61",
        "notation": {
          "kind": "sync",
          "order": 1
        }
      },
      {
        "id": "authorize",
        "from": "app",
        "to": "auth",
        "role": "message",
        "label": "Authorize",
        "labelId": "df-label-4a2dbd905287e75a5d2b",
        "notation": {
          "kind": "sync",
          "order": 2
        }
      },
      {
        "id": "code",
        "from": "auth",
        "to": "app",
        "role": "message",
        "label": "Authorization code",
        "labelId": "df-label-5694d08a2e53ffcae0c3",
        "notation": {
          "kind": "return",
          "order": 3
        }
      },
      {
        "id": "token",
        "from": "app",
        "to": "auth",
        "role": "message",
        "label": "Exchange code + PKCE",
        "labelId": "df-label-3c469e9d6c5875d37a43",
        "notation": {
          "kind": "sync",
          "order": 4
        }
      },
      {
        "id": "issued",
        "from": "auth",
        "to": "app",
        "role": "message",
        "label": "Access token",
        "labelId": "df-label-c91a3cc769f870fddc83",
        "notation": {
          "kind": "return",
          "order": 5
        }
      },
      {
        "id": "session",
        "from": "app",
        "to": "browser",
        "role": "message",
        "label": "Session established",
        "labelId": "df-label-3f3af1ecebbd1410ab41",
        "notation": {
          "kind": "return",
          "order": 6
        }
      }
    ],
    "groups": [],
    "annotations": [
      {
        "id": "df-title"
      },
      {
        "id": "df-seq-active-ab27b729d9cc4cb1c009"
      }
    ],
    "technical": {
      "family": "sequence",
      "views": [],
      "fragments": [],
      "activations": [
        {
          "id": "exchange",
          "participantId": "app",
          "fromOrder": 1,
          "toOrder": 6
        }
      ],
      "legend": [],
      "callouts": [],
      "layers": [
        "connections",
        "nodes",
        "annotations"
      ]
    }
  },
  "view": {
    "id": "main",
    "pins": [],
    "constraints": [],
    "intentionalOverlaps": [
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "browser"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "app"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "auth"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "login"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "df-label-428821350e9691491f61"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "authorize"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "df-label-4a2dbd905287e75a5d2b"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "code"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "df-label-5694d08a2e53ffcae0c3"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "token"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "df-label-3c469e9d6c5875d37a43"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "issued"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "df-label-c91a3cc769f870fddc83"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "session"
      ],
      [
        "df-seq-active-ab27b729d9cc4cb1c009",
        "df-label-3f3af1ecebbd1410ab41"
      ],
      [
        "login",
        "auth"
      ],
      [
        "authorize",
        "browser"
      ],
      [
        "code",
        "browser"
      ],
      [
        "token",
        "browser"
      ],
      [
        "issued",
        "browser"
      ],
      [
        "session",
        "auth"
      ]
    ]
  }
}
