Concepts
| Okta | Ziqme Auth |
|---|---|
| Org | Workspace |
| App integration (OIDC) | Application |
| Authorization server and its audience | The application's client ID is the audience |
| Groups assigned to an app | Per-application roles, in the roles claim |
| Profile attributes | publicMetadata and privateMetadata, mapped into claims per application |
| Identity providers (SAML, social) | SSO connections per organization, or social connections per application |
Moving users
Okta never exports password hashes. People keep their passwords by moving one sign-in at a time through lazy migration; whoever has not signed in by the cut-over is imported and asked to set a password.
- Create the applications, their roles, and organizations by slug.
- Deploy an endpoint that checks a password against Okta (below) and switch on lazy migration with its URL. From now on, the first sign-in of each Okta user creates their account here with their password.
- When sign-ins have settled, export the people who are left with the Users API: GET /api/v1/users, following the Link rel="next" header (and GET /api/v1/users/{id}/groups for roles).
- Import that file with "When the email already has an account" set to Skip, so people who already moved are untouched, and choose the application whose branded "Set your password" email the rest should get.
- Switch lazy migration off.
const okta = 'https://YOUR_ORG.okta.com', headers = { Authorization: 'SSWS ' + process.env.OKTA_API_TOKEN }
let next = okta + '/api/v1/users?limit=200', users = []
while (next) {
const response = await fetch(next, { headers })
for (const u of await response.json()) users.push({
email: u.profile.email, emailVerified: u.status === "ACTIVE",
givenName: u.profile.firstName, familyName: u.profile.lastName,
})
next = /<([^>]+)>; rel=.next./.exec(response.headers.get('link') ?? '')?.[1]
}
await import('node:fs').then(fs => fs.writeFileSync('ziqme-users.json', JSON.stringify(users)))Lazy migration against Okta
Your endpoint receives the email and password, checks the signature (see Migrating from your own database for the code), and asks Okta with the Authentication API: POST /api/v1/authn with username and password. When Okta answers status SUCCESS, answer 200 with the person (email, emailVerified, givenName, familyName); otherwise answer 401. Lazy migration only asks about addresses with no account here, which is why the import comes last.
Your endpoint sees passwords in clear. Run it yourself, check the signature, never log bodies, and switch lazy migration off when the move is done.