Commit b4525d7f authored by Clément's avatar Clément

bugfix: redirect loop

parent a2d28858
*.iml
\ No newline at end of file
/node_modules
\ No newline at end of file
<!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 src="/node_modules/oidc-client/dist/oidc-client.js"></script>
<script
src="sib-oidc.js"
data-authority="https://test-paris.happy-dev.fr/openid/"
data-client_id="833925"
data-response_type="id_token token"
data-scope="openid profile email"
data-automaticSilentRenew="true"
data-loadUserInfo="true"
></script>
</head>
<body>
<h1>sib-oidc</h1>
</body>
</html>
\ No newline at end of file
{
"name": "sib-oidc",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"babel-polyfill": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz",
"integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
"optional": true,
"requires": {
"babel-runtime": "^6.26.0",
"core-js": "^2.5.0",
"regenerator-runtime": "^0.10.5"
}
},
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"optional": true,
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
"optional": true
}
}
},
"core-js": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.2.tgz",
"integrity": "sha512-NdBPF/RVwPW6jr0NCILuyN9RiqLo2b1mddWHkUL+VnvcB7dzlnBJ1bXYntjpTGOgkZiiLWj2JxmOr7eGE3qK6g=="
},
"jsrsasign": {
"version": "8.0.12",
"resolved": "https://registry.npmjs.org/jsrsasign/-/jsrsasign-8.0.12.tgz",
"integrity": "sha1-Iqu5ZW00owuVMENnIINeicLlwxY="
},
"oidc-client": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/oidc-client/-/oidc-client-1.6.1.tgz",
"integrity": "sha512-buA9G0hlFjUwxoL/xuHunBtTgoICtJSojnZtATqMliUTKxPYAzHprOQ85Lj0hgF+Zv8lI/ViqaNFDG0Z5KCUKA==",
"requires": {
"babel-polyfill": ">=6.9.1",
"jsrsasign": "^8.0.12"
}
},
"regenerator-runtime": {
"version": "0.10.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=",
"optional": true
}
}
}
{
"name": "sib-oidc",
"version": "1.0.0",
"description": "Allows your users to login via a given OIDC provider. ## Installation Add the following within the `<head>` of your HTML: ```html <script src=\"https://cdn.happy-dev.fr/oidc-client/oidc-client.min.js\"></script> <script src=\"https://cdn.happy-dev.fr/sib-oidc/sib-oidc.js\" data-authority=\"https://some-oidc-provider.gold/openid/\" data-client_id=\"833925\" data-redirect_uri=\"http://my-app.gold\" data-response_type=\"id_token token\" data-scope=\"openid profile email\" data-automaticSilentRenew=\"true\" data-loadUserInfo=\"true\" ></script> ```",
"main": "sib-oidc.js",
"directories": {
"example": "examples"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@git.happy-dev.fr:startinblox/framework/sib-oidc.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"oidc-client": "^1.6.1"
}
}
......@@ -2,7 +2,6 @@ if (typeof Oidc == "undefined") {
throw new Error("You are missing the `oidc-client-js` lib");
}
// Var declarations
var sib = {};
sib.oidc = {};
......@@ -56,7 +55,6 @@ sib.oidc._getUser = function() {
// Connect to OIDC provider
sib.oidc._connect = function(settings) {
sib.oidc._setup(settings);
sib.oidc._getUser();
window.addEventListener('DOMContentLoaded', () => sib.oidc._getUser());
// When user loaded...
......
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