v8 -> v9
Renames
These are pure renames. A simple search/replace is enough:
- import { ... } from "oidc-spa";
+ import { ... } from "oidc-spa/core";
- import { ... } from "oidc-spa/mock";
+ import { ... } from "oidc-spa/core-mock";
- import { ... } from "oidc-spa/tools/decodeJwt";
+ import { ... } from "oidc-spa/decode-jwt";
- oidc.params.issuerUri;
+ oidc.issuerUri;
- oidc.params.clientId;
+ oidc.clientId;
- oidc.params.validRedirectUri;
+ oidc.validRedirectUri;
- const { unusbscribe } = oidc.subscribeToTokensChange(...);
+ const { unsubscribeFromTokensChange } = oidc.subscribeToTokensChange(...);
createOidc({
- noIframe: true
+ sessionRestorationMethod: "full page redirect"
});homeUrl removed
That's it.
The base url should now be provided as a param of oidcEarlyInit:
Vite Plugin and oidcEarlyInit Params changes
oidc-spa's security features have been reworked, see: Security Features
This is the changes you need to apply to migrate your current config while keeping the same security profile:
If you’re migrating from the older freeze* flags:
If you’re migrating from the older freeze* flags:
Update of keycloakUtils.getAccountUrl() API
keycloakUtils.getAccountUrl() APIThe "back to app" url actually only allows to redirect to a valid redirect uri.
Removal of oidc-spa/tools/parseKeycloakIssuerUri
oidc-spa/tools/parseKeycloakIssuerUriThere is now more comprehensive keycloak integration utils: Keycloak Utils
React entrypoint rename (breaking)
Breaking change. oidc-spa/react has been removed. Use oidc-spa/react-spa.
The overall approach is the same, but the API changed significantly.
Use the new integration guide:
Server entrypoint rename (breaking)
Breaking change. oidc-spa/backend has been removed. Use oidc-spa/server.
This was required to support DPoP. It also cleans up the API.
Use the new docs: Server integration guide
crypto.subtle polyfill
crypto.subtle polyfilloidc-spa now auto-polyfills crypto.subtle when it’s missing (typically when not served over HTTPS). This has no bundle size impact.
If you previously added webcrypto-liner-shim as described here, you can remove it.
Need a hand?
If you hit a migration edge case, ask on Discord:
Last updated
Was this helpful?