{"_id":"@dystudio/vue-keycloak-js","_rev":"6-0bbb585190821a68a5bf47478a100477","name":"@dystudio/vue-keycloak-js","dist-tags":{"latest":"1.1.12"},"versions":{"1.1.8":{"name":"@dystudio/vue-keycloak-js","version":"1.1.8","author":{"name":"dystudio","email":"dystudio@qq.com"},"description":"A Keycloak plugin for Vue >= 2.x","main":"dist/dy-vue-keycloak.cjs.js","module":"dist/dy-vue-keycloak.esm.js","browser":"dist/dy-vue-keycloak.umd.js","license":"ISC","repository":{"type":"git","url":"git+ssh://git@github.com/dystudio/vue-keycloak-js.git"},"bugs":{"url":"https://github.com/dystudio/vue-keycloak-js/issues"},"homepage":"https://github.com/dystudio/vue-keycloak-js","dependencies":{"keycloak-js":"9.0.0"},"keywords":["vue","keycloak"],"devDependencies":{"@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","rollup":"^1.9.0","rollup-plugin-babel":"^4.3.2","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-node-resolve":"^4.1.0"},"scripts":{"build":"rollup -c","dev":"rollup -c -w","version":"npm run build && git add -A","postversion":"git push -u --follow-tags origin master && npm publish"},"gitHead":"26f9f331687d5b3848572f59d59ea30006188379","_id":"@dystudio/vue-keycloak-js@1.1.8","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-jPqKjHYAfyplf9eXtPkIc7KxevjurtMd1VRVNjafDyn/H8JEzyWFkUh6xZ/EscCrfJt2Q64/oOq5DysL4G5f0w==","shasum":"f433673123388370e4ec756b3d744ba1d6198e7b","tarball":"https://registry.npmjs.org/@dystudio/vue-keycloak-js/-/vue-keycloak-js-1.1.8.tgz","fileCount":3,"unpackedSize":12606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebtnMCRA9TVsSAnZWagAAhyUQAJIwYehpqp5qKhLn3s8U\nqXmseAlrJXq/GP72ejLC1tVoSFPssEg/oqqitT5dV0a6Ew1P4xXtOTqe4Xvn\nAAI3RLMhoQcrGxdAU+Ci7M7nH8+JLPWTD8RldeQLbPAebzubhAX9PShD5ZWc\nV0Ii9WXvt7tAX4wtRnUiv1Cx7nS5Krr7wnCgN4YjhZPT+/l6QifgFRbjjaCd\nZSx2nL6z8yT/Pyr080Y27mbpsQtYIppSMp+STwL2VZVQdHKwwjcDa+LJKPA7\ny4YvBle2kuum2Bk2POgJIK7A0oooeCmxVnYzwWutHw5QzDfSXLtgCzvoCaTr\n+8wCT5uTr+/HZ9yH/IEiuVh6i2DPpjyw8OT3Z0DwJOyPAgS8yPNFLCgBEX28\n+9npuqeeha+kA/qwll0P20wCIylrZtqAq2g71yHvTGwc9p0LPz7EvnedlwoO\nkpEvzhnt+tRRnGjHs+QdeqipMySNjaM4V82P6H6Gd4PbizfczFDlCjYMT8cP\nVpg0Pz1uWPsZ6rBVnatEYl3wGLJvQy8hhgs/GDf5UZq8bzSmIO08kePZz7Jy\nO+DxYrjK9qOrt7kN4OjwWKNeFTc68r8Hk7ztU9QFeVOOjnspLGm1yPvR2dpi\nwq3EeuxY2nm9ou3c43pzZPSTvzS2BucNXyqKko/HhcCmQnR4Op7uqjhw8hfj\nqUlf\r\n=+VZb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqdQnGwL7MBZpKYWjZFg4pzvrpYXQfbIMIOSHGXcYEAwIhALI4j53bL/aEGlw3+XbbkptBtXzFxtoqDet0q4KzmJ/P"}]},"maintainers":[{"name":"david0718","email":"dystudio@qq.com"}],"_npmUser":{"name":"david0718","email":"dystudio@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-keycloak-js_1.1.8_1584323020547_0.1969476136701238"},"_hasShrinkwrap":false},"1.1.10":{"name":"@dystudio/vue-keycloak-js","version":"1.1.10","author":{"name":"dystudio","email":"dystudio@qq.com"},"description":"A Keycloak plugin for Vue >= 2.x","main":"dist/dsb-vue-keycloak.cjs.js","module":"dist/dsb-vue-keycloak.esm.js","browser":"dist/dsb-vue-keycloak.umd.js","license":"ISC","repository":{"type":"git","url":"git+ssh://git@github.com/dystudio/vue-keycloak-js.git"},"bugs":{"url":"https://github.com/dystudio/vue-keycloak-js/issues"},"homepage":"https://github.com/dystudio/vue-keycloak-js","dependencies":{"keycloak-js":"9.0.0"},"keywords":["vue","keycloak"],"devDependencies":{"@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","rollup":"^1.9.0","rollup-plugin-babel":"^4.3.2","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-node-resolve":"^4.1.0"},"scripts":{"build":"rollup -c","dev":"rollup -c -w","version":"npm run build && git add -A","postversion":"git push -u --follow-tags origin master && npm publish"},"gitHead":"0d5ef404c287a13bbc4d154c73b9f3499ba2295d","_id":"@dystudio/vue-keycloak-js@1.1.10","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-I4keKwUngKz1WZi6FRoASY25FikGeccivMLMYn5O8eDeN5WsHNqIwTjuwAUrOU+IoXqk5ZJAJ3JLZP+vlCAhoQ==","shasum":"b490740e5096eaed092851faf66b93f67babf273","tarball":"https://registry.npmjs.org/@dystudio/vue-keycloak-js/-/vue-keycloak-js-1.1.10.tgz","fileCount":3,"unpackedSize":12993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecD9BCRA9TVsSAnZWagAA4aAP/2W8jY+nvoHU3apThMYO\ndxhKU6H8MLeVCw/pCK+/lZmB13TDTGJcuJN3jhhfG7ik9UgjZ4rC6hg8FNnZ\nhq/LSzle3eD6BrA71wC1Wfvl2RdkufSf7w1Vp/wj5z/Cu9vKCafoVQkNeip/\nmsTGEbBQngewROnwQKbJTcr8mjfriZZw4gnX4L3C/zXEgE6vUOBeQcjCE2gu\n8pglzyQijcTX58Io/k63Y7AdhiPoW+mUgzgMd5g3k+IQmSJldWWWqepOwh47\nifdRwGSNqa9ML20T3DlNmAVVdVTamwFTiybKX/NPNdNmwiMqGWXBlca2MF4L\nhYwrVVJOTkgwIL3LA5KJhtXjZhMP9/AExMoZBhSk0oB1EYr7GBR2HeNLiDGS\nqiY8hEzvAhplR/mcQZk60ZwUiivO28DKsI2wJ1PhPmcp45DaaGE6GYxhP4FI\nQ3P+yitGCxBtufgqbz8pJUkbYmOaFW44SU0xgg0N/MrctQX4aauo199dXM8d\nW2+PkhmrgKmjPX+6JDU95ueM68vzjrwa28S7ygU48jFwUtQKXJuv2O9CPz71\nWkHNTStnSyetqm2guC5O6E0qx9yzbBOXGXROWQZU/763w71LELaXZoWZpNK5\nGbj5MOMGk/950nPW91riwj3B0bj40mdU7KN97azeisXDUPRDxzcC8le11qSN\ndvSr\r\n=8Qls\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9fDE1s5irRVEHtF3VKIECGbdRvnEdbmB2IdB4MocjtwIgFGwcqtA/smu5y3nT7fydTbdKAezD4tPH3QDpFOchER4="}]},"maintainers":[{"name":"david0718","email":"dystudio@qq.com"}],"_npmUser":{"name":"david0718","email":"dystudio@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-keycloak-js_1.1.10_1584414529233_0.8026196419055258"},"_hasShrinkwrap":false},"1.1.11":{"name":"@dystudio/vue-keycloak-js","version":"1.1.11","author":{"name":"dystudio","email":"dystudio@qq.com"},"description":"A Keycloak plugin for Vue >= 2.x","main":"dist/dystudio-vue-keycloak.cjs.js","module":"dist/dystudio-vue-keycloak.esm.js","browser":"dist/dystudio-vue-keycloak.umd.js","license":"ISC","repository":{"type":"git","url":"git+ssh://git@github.com/dystudio/vue-keycloak-js.git"},"bugs":{"url":"https://github.com/dystudio/vue-keycloak-js/issues"},"homepage":"https://github.com/dystudio/vue-keycloak-js","dependencies":{"keycloak-js":"9.0.0"},"keywords":["vue","keycloak"],"devDependencies":{"@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","rollup":"^1.9.0","rollup-plugin-babel":"^4.3.2","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-node-resolve":"^4.1.0"},"scripts":{"build":"rollup -c","dev":"rollup -c -w","version":"npm run build && git add -A","postversion":"git push -u --follow-tags origin master && npm publish"},"gitHead":"3d76ff0d920f1f306a3d10db29aaab972273403d","_id":"@dystudio/vue-keycloak-js@1.1.11","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-CM6P/L9af1V5U2dmjR/T2eadi85kWKGTiACIykZBifYz7txylZ8E0CXPoVR2sDMOXN2ouXdMwEYCwEQZh4qzyQ==","shasum":"bc0a0c1e044b999493fc978a8c84fe9d341303d0","tarball":"https://registry.npmjs.org/@dystudio/vue-keycloak-js/-/vue-keycloak-js-1.1.11.tgz","fileCount":3,"unpackedSize":12997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecEduCRA9TVsSAnZWagAAsTIP/ivAXNw2NvEHhQuVSGz/\nSdGlvsNyzLaN3bP2AMzO+6RqXKYdrBjdI7DCmWG/Ea0AvPRz+vMhEw761O+t\nVsIOHIeOmwjh7JvWp9qCimnnRhm8srSNnJaTSKC26h/AqaL3HkhOhFqlfgZ9\nf0bPl+i2WeXWNPQrTvA9zk7T2CRTP/AtKdee6GMvFJr78tfEd9uhV3yjH5zd\nznkaCCNR0uzAGDRVoV343VN7p+iK9oSMsxaXY8FT82+RAMoS45+3dE1gZcVf\nPTCw//QrZHl5n66Dr6sFMC8qxbxHb9HsaMjEMTuWQ46sjCi2FKwQ/7R0/9XH\nTn19gLw/EcK+Gt8nRziSMAI+0O5MU+CPMaX/6AiSha9ddRW4YsXe4nVIdGPX\nyJL6KSjuz6asaL9uttq+0qqWfjwrrm0BIbdD9fG+Uy1qdJl9XlQ0Ehwz4CxG\nOaCJ1Q6JNtu7xO0vwOcTDD0w2pTNMAByxTRhmR1yIaMUhaN9VGDq4DKIZZ4+\n9DpyfTUVIxHruoT8ihY19KHg+5FKxzfGzgZ7Ro7ehvyq4b1PeHDVqtqFCMl3\nLJltsmyb3ukt994w/5O2z10NaEcOsnUs77c+Rrr3u0EuSxGGwQAevKUOBu4q\n7zTA7uh+eMFjU2BF1ibe7zdkc73m+qmIxVkftL+HynvZQ9gWF1gSgPuWbl3c\n71e5\r\n=f+Is\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZb0mvCD2U1VKnvot7R09wyMGXnJUYcY6nKdzBG+mMbgIgS2qnTFMGOHqUsxALiAfxN8lfWtGCHa5qohtHxLpk2dc="}]},"maintainers":[{"name":"david0718","email":"dystudio@qq.com"}],"_npmUser":{"name":"david0718","email":"dystudio@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-keycloak-js_1.1.11_1584416622424_0.42099483993568265"},"_hasShrinkwrap":false},"1.1.12":{"name":"@dystudio/vue-keycloak-js","version":"1.1.12","author":{"name":"dystudio","email":"dystudio@qq.com"},"description":"A Keycloak plugin for Vue >= 2.x","main":"dist/dystudio-vue-keycloak.cjs.js","module":"dist/dystudio-vue-keycloak.esm.js","browser":"dist/dystudio-vue-keycloak.umd.js","license":"ISC","repository":{"type":"git","url":"git+ssh://git@github.com/dystudio/vue-keycloak-js.git"},"bugs":{"url":"https://github.com/dystudio/vue-keycloak-js/issues"},"homepage":"https://github.com/dystudio/vue-keycloak-js","dependencies":{"keycloak-js":"9.0.0"},"keywords":["vue","keycloak"],"devDependencies":{"@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","rollup":"^1.9.0","rollup-plugin-babel":"^4.3.2","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-node-resolve":"^4.1.0"},"scripts":{"build":"rollup -c","dev":"rollup -c -w","version":"npm run build && git add -A","postversion":"git push -u --follow-tags origin master && npm publish"},"gitHead":"7b16d62a63eee732d4b573fc0288028c54d6b2e0","_id":"@dystudio/vue-keycloak-js@1.1.12","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ithxR+qjUsT4AWUqxEUGTF1qXHKGlMjgwTrlSNcOTAneK6lucg7iTxU4FwsqCPXkWEa6jMITis2fOUl2qM4hgA==","shasum":"282691f44b46f7a066ee9a76c92fefb49b1c0e9e","tarball":"https://registry.npmjs.org/@dystudio/vue-keycloak-js/-/vue-keycloak-js-1.1.12.tgz","fileCount":6,"unpackedSize":308400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJecEm8CRA9TVsSAnZWagAAxhMP/3oVIO5jDVIHU4dwEIpq\nBCoDXbzSKLuy3y3F6QDXDnKR+qEAZfgmuA+wKMjpEF6rd+F0MKdz5KqH+ddS\nuiFVpj59V+9EZUCCGCI7EX0zrKu6HrPovwoD2PrEIiWjWO5jOzJI+/YoZdME\nPqCpCAehX32aUTWr83KSbiW8/STPK8qluGygnZ7syorcngqX/pVu1T9OkhlV\nbmDEEINQrJytRb5WxnByHrvEuFIUhLglZ2rmXIFyVxpzzGEqdw0ULXzi9ETo\nxSTK0/ESWWmb7hq8jsueWFnICDkTVailgHI0X8T7hFcgOdn1hZrOABulws1X\n8eMFvty50QbgisEo0z1YZ2omcjRat+eBPpkftZbOinFlWT99U2qHcagxMZEq\nlsoczK7AGfk5vz43rVCbJ0Z8Zs0SbRp6LqmEOS2OrPRqg4fJIp4XzH+x2le2\nzMgibr83MhhRKB6CFl85aHcq3fFP7vw6L9gXZqRnSDy9IgklBWcEOoYwQr+R\n+SFx+bNIlDEIPqCgJzTlh9WrvkB3JC5CXCUCklhkMLXTIJpSHX3EaQUpRTxC\nhDHBmvaaMKwOF05ipH1ZJtD+mQY77zXYR/wHicqMSwfNJYg4wSNe72kMq2xq\nugtAIyD+5HdDCa75wB+9g8XbwqLkHjjLd+R3NSHO4bJIRvQImAmj3DkmNBL9\n4hSy\r\n=wQ0s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQdlJ5bo5WckVv9NiAUicEhA/OMNPSwqWfAWax//5ffAiEAqiKjnb8aueeNza2WOPaLdO0FZR6JEaWCGIem7K40F9s="}]},"maintainers":[{"name":"david0718","email":"dystudio@qq.com"}],"_npmUser":{"name":"david0718","email":"dystudio@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vue-keycloak-js_1.1.12_1584417212418_0.8330028563939271"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-16T01:43:40.314Z","1.1.8":"2020-03-16T01:43:40.661Z","modified":"2022-04-05T06:19:21.355Z","1.1.9":"2020-03-16T02:24:33.788Z","1.1.10":"2020-03-17T03:08:49.404Z","1.1.11":"2020-03-17T03:43:42.568Z","1.1.12":"2020-03-17T03:53:32.535Z"},"maintainers":[{"name":"david0718","email":"dystudio@qq.com"}],"description":"A Keycloak plugin for Vue >= 2.x","homepage":"https://github.com/dystudio/vue-keycloak-js","keywords":["vue","keycloak"],"repository":{"type":"git","url":"git+ssh://git@github.com/dystudio/vue-keycloak-js.git"},"author":{"name":"dystudio","email":"dystudio@qq.com"},"bugs":{"url":"https://github.com/dystudio/vue-keycloak-js/issues"},"license":"ISC","readme":"vue-keycloak plugin\r\n-------------------\r\n\r\n[![Known Vulnerabilities](https://snyk.io/test/github/dystudio/vue-keycloak-js/badge.svg?targetFile=package.json)](https://snyk.io/test/github/dystudio/vue-keycloak-js?targetFile=package.json)\r\n![npm](https://img.shields.io/npm/v/@dystudio/vue-keycloak-js.svg?style=flat-square)\r\n![npm](https://img.shields.io/npm/dt/@dystudio/vue-keycloak-js.svg?style=flat-square)\r\n![NPM](https://img.shields.io/npm/l/@dystudio/vue-keycloak-js.svg?style=flat-square)\r\n\r\n## Introduction\r\n\r\nThis plugin uses the official Keycloak JS adapter\r\nhttps://github.com/keycloak/keycloak-js-bower\r\n\r\nPlease read the documentation:\r\nhttp://www.keycloak.org/docs/latest/securing_apps/index.html#_javascript_adapter\r\n\r\n#### Excerpt from Keycloak JS doc:\r\n\r\n> By default to authenticate you need to call the login function. However, there are two options available to make the\r\nadapter automatically authenticate. You can pass login-required or check-sso to the init function.\r\nlogin-required will authenticate the client if the user is logged-in to Keycloak or display the login page if not.\r\ncheck-sso will only authenticate the client if the user is already logged-in, if the user is not logged-in the browser\r\nwill be redirected back to the application and remain unauthenticated.\r\n\r\n> To enable login-required set onLoad to login-required and pass to the init method:\r\n\r\n> `keycloak.init({ onLoad: 'login-required' })`\r\n\r\n## Installation\r\n\r\n### Install using yarn\r\n\r\n```\r\nyarn add @dystudio/vue-keycloak-js\r\n```\r\n\r\n### Install using npm\r\n\r\n```\r\nnpm install @dystudio/vue-keycloak-js --save\r\n```\r\n\r\n## Usage\r\n\r\n> `Vue.use(VueKeyCloak, [options])`\r\n\r\nTell Vue to install the plugin, and optionally pass in a JavaScript object additional\r\nconfiguration.\r\n\r\n```javascript\r\nimport VueKeyCloak from '@dystudio/vue-keycloak-js'\r\n\r\nVue.use(VueKeyCloak)\r\n\r\n// You can also pass in options. Check options reference below.\r\nVue.use(VueKeyCloak, options)\r\n```\r\n\r\nThe plugin adds a `$keycloak` property to the global Vue instance.\r\nThis is actually a new Vue instance and can be used as such.\r\nIt shadows most of the keycloak instance's properties and functions,\r\nwith the exception of the callback events, which the plugin needs to control itself.\r\n\r\nThese properties/functions are exposed:\r\n\r\n```\r\n{\r\n  ready: Boolean,              // Flag indicating whether Keycloak has initialised and is ready\r\n  authenticated: Boolean,\r\n  userName: String,            // Username from Keycloak. Collected from tokenParsed['preferred_username']\r\n  fullName: String,            // Full name from Keycloak. Collected from tokenParsed['name']\r\n  login: Function,             // [Keycloak] login function\r\n  loginFn: Function,           // Alias for login\r\n  logoutFn: Function,          // Keycloak logout function\r\n  createLoginUrl: Function,    // Keycloak createLoginUrl function\r\n  createLogoutUrl: Function,   // Keycloak createLogoutUrl function\r\n  createRegisterUrl: Function, // Keycloak createRegisterUrl function\r\n  register: Function,          // Keycloak register function\r\n  accountManagement: Function, // Keycloak accountManagement function\r\n  createAccountUrl: Function,  // Keycloak createAccountUrl function\r\n  loadUserProfile: Function,   // Keycloak loadUserProfile function\r\n  loadUserInfo: Function,      // Keycloak loadUserInfo function\r\n  subject: String,             // The user id\r\n  idToken: String,             // The base64 encoded ID token.\r\n  idTokenParsed: Object,       // The parsed id token as a JavaScript object.\r\n  realmAccess: Object,         // The realm roles associated with the token.\r\n  resourceAccess: Object,      // The resource roles associated with the token.\r\n  refreshToken: String,        // The base64 encoded refresh token that can be used to retrieve a new token.\r\n  refreshTokenParsed: Object,  // The parsed refresh token as a JavaScript object.\r\n  timeSkew: Number,            // The estimated time difference between the browser time and the Keycloak server in seconds. This value is just an estimation, but is accurate enough when determining if a token is expired or not.\r\n  responseMode: String,        // Response mode passed in init (default value is fragment).\r\n  responseType: String,        // Response type sent to Keycloak with login requests. This is determined based on the flow value used during initialization, but can be overridden by setting this value.\r\n  hasRealmRole: Function,      // Keycloak hasRealmRole function\r\n  hasResourceRole: Function,   // Keycloak hasResourceRole function\r\n  token: String,               // The base64 encoded token that can be sent in the Authorization header in requests to services\r\n  tokenParsed: String          // The parsed token as a JavaScript object\r\n}\r\n```\r\n\r\n## Options\r\n\r\nYou can pass in an object as options to the plugin. The following keys are valid options. See below for descpription.\r\n\r\n|Key|Type|Default\r\n|---|---|---|\r\n| `config`|String &#124; Object|`window.__BASEURL__ + '/config'`\r\n|`init`|Object|`{onLoad: 'login-required'}`\r\n|`logout`|Object|\r\n|`onReady`|Function(keycloak)|\r\n|`onInitError`|Function(error)|\r\n\r\n### config\r\n\r\n**IMPORTANT NOTE**\r\n\r\nCurrently, the plugin accepts a config object like this:\r\n\r\n```\r\n{\r\n  authRealm: String,\r\n  authUrl: String,\r\n  authClientId: String,\r\n  logoutRedirectUri: String\r\n}\r\n```\r\n\r\n**This will be deprecated in the next major release.**\r\n\r\nThereafter, the config object, either returned from an endpoint (string) or\r\nset directly (object), must be compatible with the Keycloak JS adapter constructor arguments.\r\n\r\nThe `logoutRedirectUri` must instead be defined in [`options.logout`](#logout)\r\n\r\nSee description below.\r\n \r\n#### String\r\n\r\nIf this option is a string, the plugin will treat it as an URL and make an HTTP GET request to it.\r\n\r\nIf not present, the plugin will look for a global variable `window.__BASEURL__` and prepend it to `'/config'` and use\r\nthis a default place to make a GET request.\r\n\r\nIf no `window.__BASEURL__` exists, `/config` is used.\r\n\r\nThe return value from the request is used as constructor parameters for the Keycloak adapter.\r\nAs such, it should be an object with valid keys/values.\r\n\r\n[See Keycloak's Javascript adapter reference](https://www.keycloak.org/docs/latest/securing_apps/index.html#javascript-adapter-reference)\r\n\r\nE.g. \r\n\r\n```\r\n{\r\n  realm: String,\r\n  url: String,\r\n  clientId: String\r\n}\r\n```\r\n\r\nThese values will be used as constructor parameters to the official Keycloak adapter.\r\n\r\n#### Object\r\n\r\nIf this option is an object, it will be passed on as constructor parameters for the [Keycloak adapter](https://www.keycloak.org/docs/latest/securing_apps/index.html#javascript-adapter-reference).\r\nNo HTTP GET request is done in this case.\r\n\r\n### init\r\n\r\nThis option is the parameter object for the `Keycloak.init` method.\r\n\r\n### logout\r\n\r\nThis option is the parameter object for the `Keycloak.logout` method.\r\n\r\n### onReady\r\n\r\nThis option is a callback function that is executed once Keycloak has initialised and is ready. You can be sure\r\nthat the Vue instance has a property called `$keycloak` in this function. See above for possible values.\r\n\r\nThe callback function has one parameter, which is the keycloak object returned from the Keycloak adapter on\r\ninstantiation.\r\n\r\nOne use case for this callback could be to instantiate and mount the Vue application. Then we are sure that the Keycloak\r\nauthentication and the `$keycloak` property are properly finished and hydrated with data:\r\n\r\n```javascript\r\nVue.use(VueKeyCloak, {\r\n  onReady: (keycloak) => {\r\n    console.log(`I wonder what Keycloak returns: ${keycloak}`)\r\n    /* eslint-disable no-new */\r\n    new Vue({\r\n      el: '#app',\r\n      router,\r\n      template: '<App/>',\r\n      render: h => h(App)\r\n    })\r\n  }\r\n})\r\n```\r\n\r\nIn conjunction with the above, you might find it useful to intercept e.g. axios and set the token on each request:\r\n\r\n```javascript\r\nfunction tokenInterceptor () {\r\n  axios.interceptors.request.use(config => {\r\n    config.headers.Authorization = `Bearer ${Vue.prototype.$keycloak.token}`\r\n    return config\r\n  }, error => {\r\n    return Promise.reject(error)\r\n  })\r\n}\r\n\r\nVue.use(VueKeyCloak, {\r\n  onReady: (keycloak) => {\r\n    tokenInterceptor()\r\n    /* eslint-disable no-new */\r\n    new Vue({\r\n      el: '#app',\r\n      router,\r\n      template: '<App/>',\r\n      render: h => h(App)\r\n    })\r\n  }\r\n})\r\n```\r\n\r\n### onInitError\r\n\r\nThis option is a callback function that is executed if Keycloak initialisation has failed.\r\n\r\nThe callback function has one parameter, which is the error object returned by Keycloak. Note that this may be undefined\r\neven though an error has occurred, as Keycloak does not return an error object in every error case.\r\n\r\n## Examples\r\n\r\n### Supply a configuration object for the Keycloak constructor\r\n\r\n```javascript\r\nVue.use(VueKeyCloak, {\r\n  config: {\r\n    realm: 'MyRealm',\r\n    url: 'https://my.keycloak.server/auth',\r\n    clientId: 'MyClientId'\r\n  },\r\n  onReady: kc => {\r\n    new Vue({\r\n      render: h => h(App)\r\n    }).$mount('#app')\r\n  }\r\n})\r\n```\r\n\r\n### Supply init option (disable monitoring login state)\r\n\r\n```javascript\r\nVue.use(VueKeyCloak, {\r\n  init: {\r\n    onLoad: 'login-required',\r\n    checkLoginIframe: false\r\n  },\r\n  onReady: kc => {\r\n    new Vue({\r\n      render: h => h(App)\r\n    }).$mount('#app')\r\n  }\r\n})\r\n```\r\n\r\n### Supply init option (use `check-sso`)\r\n\r\nRemember; `login-required` is the default value for the onLoad property \r\nin the init object. So without passing an `init` object as argument, the default is \r\n`{ init: 'login-required' }`\r\n\r\n```javascript\r\nVue.use(VueKeyCloak, {\r\n  init: {\r\n    onLoad: 'check-sso'\r\n  },\r\n  onReady: kc => {\r\n    new Vue({\r\n      render: h => h(App)\r\n    }).$mount('#app')\r\n  }\r\n})\r\n```\r\n\r\n### Specify a `redirectUri`\r\n\r\n```javascript\r\nVue.use(VueKeyCloak, {\r\n  logout: {\r\n    redirectUri: 'https://mydomain.lives.here.com'\r\n  },\r\n  onReady: kc => {\r\n    new Vue({\r\n      render: h => h(App)\r\n    }).$mount('#app')\r\n  }\r\n})\r\n```\r\n\r\n### Example application\r\n\r\nView a complete example app, with router guards:\r\n\r\n[hello-keycloak](https://github.com/dystudio/vue-keycloak-js/tree/master/examples)\r\n\r\n## Develop and deploy\r\n\r\n```bash\r\n$ git clone https://github.com/dystudio/vue-keycloak-js.git\r\n# Do some work, add and/or commit to git.\r\n$ npm version patch\r\n```\r\n\r\nThe command `npm version patch` will automatically run the build, push the branch upstream and publish the package to\r\nthe NPM registry\r\n\r\n## Frequently asked questions\r\n\r\nWe try to answer the most frequently asked questions here.\r\n\r\n### How can I specify client secret?\r\n\r\nShort answer: You should not.\r\n\r\nFor some mysterious reasons, there is undocumented support for it in the Keycloak Javascript Adapter, but it makes little sense to use it. The secret must be present in the browser, and is therefore no longer a secret. See [issue 22](https://github.com/dystudio/vue-keycloak-js/issues/22).\r\n\r\nThe client secret is [removed from Keycloak 8.0](https://www.keycloak.org/docs/latest/release_notes/index.html#credentials-support-removed-from-the-javascript-adapter).\r\n","readmeFilename":"README.md"}