OpenID Connect authentication support for Nuxt.js
$ npm install nuxt-oidc
// nuxt.config.js
{
modules: [
'@nuxtjs/axios',
'nuxt-oidc',
],
oidc: {
issuer: '<Your issuer>',
clientId: '<Client ID>',
clientSecret: '<Client Secret>',
callbackUrl: 'http://localhost:3000/oidc/callback',
scope: [
'email',
'profile',
'address',
],
// express-session configuration
session: {
secret: '<secret>',
cookie: {},
resave: false,
saveUninitialized: false,
},
},
}
Use oidc
middleware for pages that require authentication.
<script>
export default {
middleware: ['oidc']
}
</script>
See sample directory for more details.
MIT License - Copyright (c) deko2369