@centadt/oidc
Setup
yarn add cookie-universal-nuxt @centadt/oidc
add index.js in "store" folder
add below code snippet in nuxt.config.js
server: { port: 33235 },
modules: [
'cookie-universal-nuxt',
'@nuxtjs/axios',
['@centadt/oidc', {
authority: "authority",
client_id: "clientId",
redirect_uri: "http://localhost:33235/login",
post_logout_redirect_uri: "http://localhost:33235/logout",
silent_redirect_uri: "http://localhost:33235/login",
scope: "openid profile centanetapi offline_access",
}]
],
router: {
middleware: ['route']
},
Code example
login
<button @click="login">login</button>
methods: {
login() {
this.$oidc.getOidcManager().signinRedirect({
prompt: "login",
extraQueryParams: {
platform: "web",
},
});
}
}
logout
<button @click="logout">logout</button>
methods: {
logout() {
this.$oidc.clearCentaLoginToken();
}
}
Version History
| Version | Released | License |
|---|---|---|
| 2.11.24 | MIT | |
| 2.11.23 | MIT | |
| 2.11.21 | MIT | |
| 2.11.19 | MIT | |
| 2.11.18 | MIT | |
| 2.11.17 | MIT | |
| 2.11.16 | MIT | |
| 2.11.15 | MIT | |
| 2.11.14 | MIT | |
| 2.11.13 | MIT | |
| 2.11.12 | MIT | |
| 2.11.11 | MIT | |
| 2.11.10 | MIT | |
| 2.11.9 | MIT | |
| 2.11.8 | MIT | |
| 2.11.7 | MIT | |
| 2.11.6 | MIT | |
| 2.11.5 | MIT | |
| 2.11.4 | MIT | |
| 2.11.3 | MIT | |
| 2.11.2 | MIT |