How to migrate from pas.plugins.oidc#
Move a site from pas.plugins.oidc to this package—and find out whether your
site can move at all.
This migration is harder than the authomatic one, and it may refuse.
pas.plugins.oidc stores no identity mapping. It derives a user id from a
configurable claim, creates a source_users account with that id, and keeps
nothing else. So the migration has to reconstruct a join that was never written
down.
Important
This is a hard cutover. Running the old plugin and this one side by side is not supported and not tested.
Steps#
Check
user_property_as_useridon the old plugin. This decides whether you can migrate at all.Value
Outcome
sub, the defaultThe Plone user id is the subject, so the join reconstructs exactly. Continue.
anything else, usually
emailThe
subwas never written down and cannot be recovered. The migration refuses.A site in the second row should stay on
pas.plugins.oidcfor now. The migration refuses rather than producing a plausible-looking wrong join.Back up the database.
Decide which accounts are yours. Nothing marks an account as OIDC-created, so the migration cannot tell one from an account an administrator typed in. It will not guess.
If the site used OIDC exclusively, take every
source_usersaccount:from pas.plugins.identity.migration import oidc report = oidc.migrate()
If the site has a mix, name the user ids instead:
report = oidc.migrate(userids=["sub-alice", "sub-bob"])
Warning
The default claims every
source_usersaccount as an OIDC identity. On a mixed site that is wrong, and it is wrong in a way that is easy to miss.The dry-run report lists exactly which user ids would be claimed. That is how you find out before it matters.
Read the dry run.
migrate()writes nothing unless you tell it to.print(report.as_dict())
Check
refusedfirst: when it is true, nothing was done and nothing will be until you deal with the reason inrefusals. Then readidentitiesand confirm every user id listed is one you meant to claim.Every field a report carries is in Migration reports.
Run the migration.
report = oidc.migrate(dry_run=False)
Or, for a mixed site:
report = oidc.migrate(userids=["sub-alice", "sub-bob"], dry_run=False)
It is idempotent. Running it twice does nothing the second time.
Update the redirect URI at the provider to the callback URL you set during How to install the backend, by default
https://www.example.com/login-identity.Remove the old plugin.
Verify#
Sign in with the provider.
Confirm you land on the account you had before, not a new one.
Check the audit log for an
authenticatedentry.
If a sign-in fails, read the audit log first—see How to read the audit log and How to troubleshoot sign-in.
What comes across#
Provider configuration translates cleanly, because it all lives on the plugin: issuer, client id, client secret, scope, and title.
Next steps#
Migration reports—every field and refusal
How to export and import principals—the alternative when the old site is elsewhere
How to troubleshoot sign-in—if somebody lands on a new account