index.html 1.21 KB
Newer Older
Clément's avatar
Clément committed
1 2 3 4 5 6 7
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>SIB-OIDC test</title>
Nicolas Mérigot's avatar
Nicolas Mérigot committed
8
    <script type="module" src="./sib-oidc.js"></script>
Clément's avatar
Clément committed
9 10
  </head>
  <body>
11
    <sib-auth
12 13
      data-authority="https://test-paris.happy-dev.fr/openid/"
      data-client_id="833925"
14
    ></sib-auth>
Clément's avatar
Clément committed
15
    <h1>sib-oidc</h1>
Clément's avatar
Clément committed
16 17 18 19 20 21 22 23 24 25 26
    <button id="reset">clear storage and set new URL</button>
    <button id="reload">reload</button>
    <script>
      reset.onclick = () => {
        window.sessionStorage.clear();
        window.localStorage.clear();
        history.pushState({}, '', '.?time=' + new Date().toLocaleTimeString());
      };
      reload.onclick = () => location.reload();
    </script>

Nicolas Mérigot's avatar
Nicolas Mérigot committed
27 28
    <script type='module'>
      import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.5';
29

Nicolas Mérigot's avatar
Nicolas Mérigot committed
30 31 32 33 34 35 36
      class TestComponent extends SIBBase {
        async connectedCallback() {
          const user = await this.getUser();
          this.innerHTML = JSON.stringify(user);
        }
      }
      customElements.define('sib-test', TestComponent);
Clément's avatar
Clément committed
37
    </script>
Nicolas Mérigot's avatar
Nicolas Mérigot committed
38 39

    <sib-test></sib-test>
Clément's avatar
Clément committed
40
  </body>
Clément's avatar
Clément committed
41
</html>