👨🔧User impersonation
Enable the admin of your application to login as a given user.
import { createOidc } from "oidc-spa";
const oidc = await createOidc({
// ...
getDoContinueWithImpersonation: async ({ parsedAccessToken })=> {
const doContinue = confirm(`
WARNING: You are about to impersonate ${parsedAccessToken.email}.
If you don't understand why you are seeing this message please
click cancel and contact support.
Someone might be trying to trick you.
`);
return doContinue;
}
});import { createReactOidc } from "oidc-spa/react";
export const { OidcProvider, useOidc, getOidc } = createReactOidc({
// ...
getDoContinueWithImpersonation: async ({ parsedAccessToken })=> {
const doContinue = confirm(`
WARNING: You are about to impersonate ${parsedAccessToken.email}.
If you don't understand why you are seeing this message please
click cancel and contact support.
Someone might be trying to trick you.
`);
return doContinue;
}
});
Crafting the URL for Impersonation
Last updated
Was this helpful?