npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

client-oidc

v1.0.47

Published

An implementation for OIDC

Downloads

905

Readme

Client-oidc for Nuxt 3

npm version npm downloads License Nuxt

A basic implementation for an oidc client for Nuxt 3.

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add client-oidc

or

npm install client-oidc
export default defineNuxtConfig({
  ...
  modules: ["client-oidc"],
  ...
});

And manually add client-oidc in nuxt.config.ts

export default defineNuxtConfig({
  ...
  clientOidc: {
    // Add your config here
  },
  ...
});

Config options

There are different options possible in the config. Some are mandatory and others are optional. Here follows a list of all options:

Config with .env file

# Public config (for client-side access)
NUXT_PUBLIC_CLIENT_OIDC_IS_ENABLED=
NUXT_PUBLIC_CLIENT_OIDC_ENDPOINTS_BASE_URL=
NUXT_PUBLIC_CLIENT_OIDC_ENDPOINTS_LOGIN=
NUXT_PUBLIC_CLIENT_OIDC_ENDPOINTS_LOGIN_CALLBACK=
NUXT_PUBLIC_CLIENT_OIDC_ENDPOINTS_ACCESS_TOKEN=
NUXT_PUBLIC_CLIENT_OIDC_ENDPOINTS_USERINFO=
NUXT_PUBLIC_CLIENT_OIDC_ENDPOINTS_LOGOUT=
NUXT_PUBLIC_CLIENT_OIDC_ENDPOINTS_LOGOUT_CALLBACK=

# Private config (for server-side only)
NUXT_CLIENT_OIDC_CONFIG_ISSUER=
NUXT_CLIENT_OIDC_CONFIG_CLIENT_ID=
NUXT_CLIENT_OIDC_CONFIG_REDIRECT_URL=
NUXT_CLIENT_OIDC_CONFIG_ACR_VALUES=
NUXT_CLIENT_OIDC_CONFIG_POST_LOGOUT_REDIRECT_URIS=
NUXT_CLIENT_OIDC_CONFIG_CLIENT_SECRET=
NUXT_CLIENT_OIDC_CONFIG_SCOPE=
NUXT_CLIENT_OIDC_CONFIG_ALLOWED_ROLES=
export default defineNuxtConfig({
  ...
  runtimeConfig: {
      public: {
        clientOidc: {
          isEnabled: '',
          endpoints: {
            baseUrl: '',
            login: '',
            loginCallback: '',
            accessToken: '',
            userinfo: '',
            logout: '',
            logoutCallback: '',
          },
        },
      },
      clientOidc: {
        config: {
          issuer: '',
          clientId: '',
          redirectUrl: '',
          acrValues: '',
          postLogoutRedirectUris: '',
          clientSecret: '',
          scope: '',
          allowedRoles: '',
        },
      },
    },
});

Config without using environment variables

export default defineNuxtConfig({
  ...
  clientOidc: {
    isEnabled: '', // Type: Boolean - Enable or disable the module easily
    config: {
      issuer: '', // * Type: String - The OIDC provider which authenticates users and issues ID tokens, access tokens, ...
      clientId: '', // * Type: String - A unique identifier assigned to a client application, used to identify and authenticate the client when interacting with the OIDC provider.
      clientSecret: '', // * Type: String
      redirectUrl: '', // * Type: String
      acrValues: '', // * Type: String
      scope: '', // * Type: String
      allowedRoles: '', // * Type: String
      postLogoutRedirectUris: '', // * Type: String
      response_type: 'code',
      id_token_signed_response_alg: 'RS256',
      userinfo_signed_response_alg: 'RS256',
      authorizationUri: '/authorize',
      tokenUri: '/access_token',
      jwkUri: '/connect/jwk_uri',
      userInfoUri: '/userinfo',
      introspectionUri: '/introspect',
      endSessionUri: '/connect/endSession',
    },
    endpoints: {
      baseUrl: '', // Type: String
      login: '', // Type: String
      loginCallback: '', // Type: String
      accessToken: '', // Type: String
      userinfo: '', // Type: String
      logout: '', // Type: String
      logoutCallback: '', // * Type: String
    },
  },
  ...
});

Contribution

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release