Check the existing StoredID database for a value and return it if present
If a value is not present, request one from the ComputedID generator instead
An approximation in pseudo-code:
stored_id = get_stored_value(user, service);
then return stored_id;
else return get_computed_value(user, service);
This example uses SQLite as a target database engine for the (read-only) data set. Firstly because it’s really simple. Secondly, if you’re making this jump then no “new” data will be added to the database so the file can be statically deployed to your IdP nodes with no need to worry about another RDBMS and replication etc.
This assumes you have a working StoredID connector servicing requests for persistent IDs, for example:
This configuration will be happily servicing requests for eduPersonTargetedID by first looking them up in the database, returning the value if it’s present and, otherwise, generating one, storing it and returning it.
Switching this basic config to the desired model… I’ve switched from the examples generating storedID to persistentId as it’s more descriptive.