DPoP
OAuth 2.0 Demonstrating Proof-of-Possession
Enabling DPoP
import { defineConfig } from "vite";
import { oidcSpa } from "oidc-spa/vite-plugin";
export default defineConfig({
plugins: [
// ...
oidcSpa({
browserRuntimeFreeze: { enabled: true, /*exclude: [...]*/ }, //Recommended
DPoP: { enabled: true, mode: "auto" }
})
]
});import { oidcEarlyInit } from "oidc-spa/entrypoint";
import { browserRuntimeFreeze } from 'oidc-spa/browser-runtime-freeze';
import { DPoP } from 'oidc-spa/DPoP';
const { shouldLoadApp } = oidcEarlyInit({
BASE_URL: "/",
securityDefenses: {
...browserRuntimeFreeze(/*{ exclude: [...] }*/), // Recommended
...DPoP({ mode: "auto" })
},
});
if (shouldLoadApp) {
// Note: Deferring the main app import adds a few milliseconds to cold start,
// but dramatically speeds up auth. Overall, it's a net win.
import("./main.lazy");
}What does enabling DPoP require?
How it works
Last updated
Was this helpful?