summaryrefslogtreecommitdiffstats
path: root/dom/credentialmanagement/identity/tests/mochitest/server_idtoken_redirect_accounts.sjs
blob: 9baeb51ba55318287d3c6a0196ba2d4d29d84541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

function handleRequest(request, response) {
  response.setHeader("Access-Control-Allow-Origin", "*");
  response.setHeader("Access-Control-Allow-Credentials", "true");
  response.setHeader("Content-Type", "application/json");
  let content = {
    accounts: [
      {
        id: "1234",
        given_name: "John",
        name: "John Doe",
        email: "john_doe@idp.example",
        picture: "https://idp.example/profile/123",
        approved_clients: ["123", "456", "789"],
      },
    ],
  };
  let body = JSON.stringify(content);
  response.setStatusLine(request.httpVersion, 200, "OK");
  response.write(body);
}