Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By volverjsMITIn 1 marketplace
Adds OAuth2 and OpenID Connect login to a Vue 3 app, with PKCE, token refresh and logout handled by an OAuthClient class. Its default stores the refresh token in localStorage, which it warns any page script can read; set storageType to 'session' to avoid that.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
# pnpm
pnpm add @volverjs/auth-vue
# yarn
yarn add @volverjs/auth-vue
# npm
npm install @volverjs/auth-vue --save
This library exports three main classes: OAuthClient, LocalStorage and SessionStorage (plus the abstract Storage base class).
import { LocalStorage, OAuthClient, SessionStorage } from '@volverjs/auth-vue'
LocalStorage and SessionStorage provide a way to interact with the browser localStorage and sessionStorage APIs.
All the keys are scoped by the instance name, so you can use the same key name in different storages.
import { LocalStorage } from '@volverjs/auth-vue'
if (LocalStorage.supported()) {
const myLocalStorage = new LocalStorage('my-local-storage')
// set a specific key
myLocalStorage.set('my-key', 'my-value')
// get a specific key
myLocalStorage.get('my-key', 'default-value')
// delete a specific key
myLocalStorage.delete('my-key')
// clear all keys present in our storage
myLocalStorage.clear()
}
The OAuthClient class is a wrapper of oauth4webapi to simplify the authentication process of a Vue 3 application.
By default it uses LocalStorage to store the refresh token, the code verifier and the PKCE/OIDC state and nonce values.
[!WARNING] By default the refresh token is persisted in
localStorage, which survives tab closes and browser restarts and is readable by any JavaScript on the origin (a single XSS flaw exposes it). SetstorageType: 'session'(or provide a custom storage) when you don't need persistent, cross-tab sessions.
import { ClientSecretBasic, OAuthClient, SessionStorage } from '@volverjs/auth-vue'
const authClient = new OAuthClient({
// The URL of the OAuth issuer
url: 'https://my-oauth-server.com',
// The client id of the application
clientId: 'my-client-id',
// The client authentication method, default: None()
// Are also supported: ClientSecretPost, ClientSecretBasic, PrivateKeyJwt, None, TlsClientAuth
clientAuthentication: ClientSecretBasic('my-client-secret'),
// The scopes requested to the OAuth server
scopes: 'openid profile email',
// Convenience setting to choose the storage, default: 'local'
// Use 'session' to persist into sessionStorage instead of localStorage
storageType: 'session',
// The storage to use for persisting the refresh token, default: new LocalStorage('oauth')
// Takes precedence over `storageType` when provided
storage: new SessionStorage('my-session-storage'),
// The redirect URI of the application, default: document.location.origin
redirectUri: 'https://my-app.com/callback',
// The URI to redirect the user after the logout, default: document.location.origin
postLogoutRedirectUri: 'https://my-app.com',
// The API the access token is for (RFC 8707), sent as `resource` on the
// authorization and token requests. Some servers only issue a JWT access
// token, instead of an opaque one, when the audience is stated this way.
// Pass an array to request more than one audience.
resource: 'https://my-oauth-server.com/api',
})
The OAuthClient class provides a set of (async) methods to interact with the OAuth server:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub volverjs/auth-vue --plugin volverjs-auth-vuePlugins from other owners that cover similar ground