Commit 9b11aa7f authored by Clément's avatar Clément

update: remove old example

parent b0fe36dc
Pipeline #2165 passed with stage
in 52 seconds
<!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>
<script type="module" src="../sib-oidc.js"></script>
</head>
<body>
<sib-auth
data-authority="https://test-paris.happy-dev.fr/openid/"
data-client_id="833925"
></sib-auth>
<h1>sib-oidc</h1>
<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>
<pre id="output"></pre>
<script>
sibOidc = document.querySelector('sib-auth');
customElements.whenDefined('sib-auth').then(() => {
sibOidc.getUser().then(user => {
console.log(user);
output.textContent = JSON.stringify(user, null, 2);
});
});
</script>
</body>
</html>
......@@ -6,27 +6,41 @@
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>SIB-OIDC test</title>
<script type="module" src="./index.js"></script>
<style>
sib-test {
display: block;
}
</style>
</head>
<body>
<h1>sib-oidc</h1>
<button id="reset">clear storage and set new URL</button>
<button id="reload">reload</button>
<sib-test>
<button id="login">Se connecter</button>
<button id="logout">Se déconnecter</button>
<button id="stat">Status (console)</button>
<div id="result"></div>
</sib-test>
<sib-auth>
<sib-auth-provider
class="sib-auth-provider"
data-authority="https://test-paris.happy-dev.fr/openid/"
data-client_id="833925"
data-id="paris"
class="sib-auth-provider"
data-authority="https://test-paris.happy-dev.fr/openid/"
data-client_id="833925"
data-id="paris"
>
</sib-auth-provider>
<sib-auth-provider
class="sib-auth-provider"
data-authority="https://test-paris.happy-dev.fr/openid/"
data-client_id="833925"
data-id="paris2"
class="sib-auth-provider"
data-authority="https://test-paris.happy-dev.fr/openid/"
data-client_id="833925"
data-id="paris2"
>
</sib-auth-provider>
</sib-auth>
<h1>sib-oidc</h1>
<button id="reset">clear storage and set new URL</button>
<button id="reload">reload</button>
<script>
reset.onclick = () => {
window.sessionStorage.clear();
......@@ -36,12 +50,12 @@
reload.onclick = () => location.reload();
</script>
<script type='module'>
<script type="module">
import { SIBBase } from 'https://unpkg.com/@startinblox/core@0.5';
class TestComponent extends SIBBase {
async connectedCallback() {
stat.onclick = () => this.getStatus();
stat.onclick = () => console.log(this.getStatus());
login.onclick = () => this.triggerLogin();
logout.onclick = () => this.triggerLogout();
......@@ -70,14 +84,5 @@
}
customElements.define('sib-test', TestComponent);
</script>
<sib-test>
<div id="result">
</div>
<button id="login">Se connecter</button>
<button id="logout">Se déconnecter</button>
<button id="stat">Status</button>
</sib-test>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment