Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itpropro/nuxt-oidc-auth

OIDC (OpenID connect) focused auth module for Nuxt
https://github.com/itpropro/nuxt-oidc-auth

authentication nuxt nuxtjs oauth oauth2 openid-connect security vue

Last synced: 24 days ago
JSON representation

OIDC (OpenID connect) focused auth module for Nuxt

Awesome Lists containing this project

README

        

[![nuxt-oidc-auth-social-card](https://github.com/itpropro/nuxt-oidc-auth/assets/15030951/41173d50-afd4-4d1e-8cd0-e377d7f7effc)](https://nuxt.com/modules/nuxt-oidc-auth)

# Nuxt OIDC Auth

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

Welcome to __Nuxt OIDC Auth__, a Nuxt module focusing on native OIDC (OpenID Connect) based authentication for Nuxt with a high level of customizability and security for SSR applications.
This module doesn't use any external dependencies outside of the [unjs](https://unjs.io/) ecosystem except for token validation (the well known and tested `jose` library for JWT interactions).

๐Ÿ‘‰ [Documentation](https://nuxtoidc.cloud/)

## Features

โ†ฉ๏ธย  Automatic session and token renewal

๐Ÿ’พย  Encrypted server side refresh/access token storage powered by Nitro storage

๐Ÿ”‘ย  Token validation

๐Ÿ”’ย  Secured & sealed cookies sessions

โš™๏ธย  Presets for popular OIDC providers

๐Ÿ“คย  Global middleware with automatic redirection to default provider or a custom login page (see playground)

๐Ÿ‘คย  `useOidcAuth` composable for getting the user information, logging in and out, refetching the current session and triggering a token refresh

๐Ÿ—‚๏ธย  Multi provider support with auto registered routes (`/auth//login`, `/auth//logout`, `/auth//callback`)

๐Ÿ“ย  Generic spec OpenID compatible connect provider with fully configurable OIDC flow (state, nonce, PKCE, token request, ...)

๐Ÿ•™ย  Session expiration check

## Installation

### Add `nuxt-oidc-auth` dependency to your project

With nuxi

```bash
pnpm dlx nuxi@latest module add nuxt-oidc-auth
```

or manually

```bash
pnpm add -D nuxt-oidc-auth
```

Add `nuxt-oidc-auth` to the `modules` section of `nuxt.config.ts`

```js
export default defineNuxtConfig({
modules: [
'nuxt-oidc-auth'
]
})
```

## โš ๏ธ Disclaimer

This module is still in development, feedback and contributions are welcome! Use at your own risk.

[npm-version-src]: https://img.shields.io/npm/v/nuxt-oidc-auth?labelColor=18181B&color=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-oidc-auth

[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-oidc-auth?labelColor=18181B&color=28CF8D
[npm-downloads-href]: https://npmjs.com/package/nuxt-oidc-auth

[license-src]: https://img.shields.io/npm/l/nuxt-oidc-auth?labelColor=18181B&color=28CF8D
[license-href]: https://npmjs.com/package/nuxt-oidc-auth

[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com