I wonder, is there a technical reason why we are using a collection for Identifiers and match by a "key" per type?
Usually you would only use classic dependency inversion and assign an identifier to a authenticator, done.
That way there wouldn't be any risks for collision (same key used twice by accident).
If there is a good reason:
Should we add - in debug mode - a check that those defined in the collection do not use the same key?
some use "sub", "id", "key" and "username", but custom ones put in on first sight would not necessarily be very clear here,
and there can be a change that something goes wrong, with auth I am not sure we want to take that risk.
I wonder, is there a technical reason why we are using a collection for Identifiers and match by a "key" per type?
Usually you would only use classic dependency inversion and assign an identifier to a authenticator, done.
That way there wouldn't be any risks for collision (same key used twice by accident).
If there is a good reason:
Should we add - in debug mode - a check that those defined in the collection do not use the same key?
some use "sub", "id", "key" and "username", but custom ones put in on first sight would not necessarily be very clear here,
and there can be a change that something goes wrong, with auth I am not sure we want to take that risk.