Hello, I would really appreciate some help on sche...
# ory-network
a
Hello, I would really appreciate some help on schema configuration, I’ve encountered some very odd behavior. We are currently working on a migration of our custom auth solution to Ory Network. After moving all configuration to git according to the docs something really strange happened some time after running
ory set identity-config
. In our development project I had created two custom schemas mostly for testing different behaviors. In the console, the name I assigned to the schemas became the title and a generated id had been assigned. When looking at the identity configuration the generated ids of the schemas where used as identifiers and the name I had assigned were not part of the the configuration. I think it was when I removed one of the schemas in the identity config (I was curious what would happen) when things went sideways but I’m not sure. Duplicates of my custom schemes had been created, this time the generated id of the original schema became the title of the duplicate, and a new unique id had been assigned to it. But it gets weirder, as you can see in the screenshot the list contains the duplicated schemas multiple times (with the same title and id). For every time i save my identity config with
ory set identity-config
a new set appears in the list, so it grows longer and longer. I can no longer configure my original schema as default, the configuration falls back to using the duplicate instead. Also, the complete list of all duplicates are listed in every project. Now comes the weirdest part, my user is the only one that sees all these extra duplicates that keeps growing and my user is also the only one that sees all schemas no matter what project is selected. Every other member on my team can see the duplicates in the staging project (they are part of the identity config now to that makes sense), but they only appear once in the list as it should be. When they change the project they only see the presets since no custom schemas have been created in those projects yet. But my user is seeing every schema no matter what. I don’t really know how to move on, I’m thinking of deleting the development project and recreate it to see what happens.
m
Thanks for the report Johannes! We're aware that the identity schema listing is not ideal at the moment to put it mildly - apologies for the inconvenience here! we are looking to improve this in the near future, but it's quite a complex change (since extra precautions need to be taken to not break anything). As far as I know at the moment the schemas are saved per Ory Console user - that is why only you see the duplicate schemas. So deleting the project won't help in this case.
For every time i save my identity config with
ory set identity-config
a new set appears in the list, so it grows longer and longer. I can no longer configure my original schema as default, the configuration falls back to using the duplicate instead.
I'm not sure why this is the case though, seems like an edge case/bug in the CLI - haven't seen this one before. I will check in with our backend team if there is something they can do to help resolve your situation while we are working to improve the identity schema handling overall - maybe we can "reset" your user to delete all the custom schemas you have configured, but I can't promise a immediate resolution at this point.
a
Thank you Vincent! I really appreciate the help. It would be fantastic if a reset was possible, but I would understand if its not possible. What is the safe way to deal with the schemas? Because there seem to be some contradictions in the docs. The “Manage identity schemas” page says schemas are immutable which I have now realized is 100% correct, but in “Manage Ory Network configuration in git” there is a section that gave me the impression that you can actually update the contents of existing schemas. Th AI bot also believes this, most likely because it has made the same interpretation of the docs as me 😄) And it is probably the ambiguity of that section that lead me into experimenting in ways leading up to the current situation. Because I think I understand now how I have been able to create this mess. When running
ory set identity-config
after having updated the url of an existing schema to the base64 representation (a step in my CI/CD pipeline I thought was smart) then that is when a duplicate with the same title and id appears in the console. And if the same step is performed but there is actually a change in the contents of the schema, a new schema with a new id is created (and the title being the id of the original since the entered id of new schemas becomes the title in the console and the id in the schema is replaced by the generated hash). If my assumptions are correct though, then that means there is yet another contradiction in the docs under “Identity schema best practices”. There is a snippet there (the image below) showing the original name of the custom schemas in the config instead of the generated hashes as well as the base64 representation of both schemas, which is exactly what has seemed to give me trouble. Anyways, my conclusion to avoid the similar issues in the future, is to never touch the schemas array in the identity config directly.
m
Hey Johannes, Haven't gotten around to checking further but have set a reminder to look into it next week. I will also look into updating the docs there to make it less confusing. Thanks for the investigation, this helps a lot shave off the sharp edges!