-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metadataSeed.authorization_endpoint
not prioritized over remote metadata
#1803
Comments
metadata.authorization_endpoint
while getting rest of metadata from the metadata endpointmetadataSeed.authorization_endpoint
not prioritized over remote metadata
+1. |
If you need a short-term solution, you can use a custom fork/patch as per this PR. I've tested it myself: https://github.com/authts/oidc-client-ts/pull/1804/files |
Thanks for providing context about this merging use case. The initial idea was that what the IdP returns as metadata is correct and would enrich the seed. Which does not work in your case. On the other hand i really makes sense to let seed win, as it is anyway optional. I am just thinking about not breaking existing applications. I guess i just have to reflect this with a version minor bump, instead of a bugix... |
Thanks for considering it! As mentioned above, it ended up being a poor solution for us, since But yes, from my perspetive it is intuitive for My perspective is grounded in the assumption that the IdP response will be complete and return with no failure. Others may use |
We have a niche use case for which I've come to conclude that we would like to use
metadataSeed
.Use case
For one particular client, the user knows themselves by an id of a particular series, let's say a number. The auth server, on the other hand, only knows the user as a GUID. To map from the number to the GUID, an intermediary which is aware of both the number and the GUID must be used.
Ideally, we would want to change the
authorization_endpoint
to point to this intermediary, only for this client, without impacting other users of our identity server. The intermediary would the handle the input of the number, convert it to the GUID, and redirect the user onward to the normal flow on the auth server.EDIT: Turns out this is a bad idea since the
authorization_endpoint
is also used for refreshing the token, something we don't want to use the proxy for. So we'll have to look for another solution. Either way, the bug remains.Tested approaches
I found two approaches within the library's API:
metadata.authorization_endpoint
. This comes with two drawbacks:metadata
is added to the local definition, the call fetch the remote metadata is never sent. This means that we have to define all of the metadata locally, which is obviously a source of unwanted duplication.metadataSeed
which sound like an excellent fit, but it seems that the remote value is prioritized over the seeded value? The implementation goes likeObject.assign({}, this._settings.metadataSeed, metadata)
, and as per Object.assign docs, later occurrences (i.e.metadata
) override earlier occurrences (in this casethis._settings.metadataSeed
). When doing debug logging, we can see this in action:Is the prioritization of remote metadata over
metadataSeed
a straight up bug in the MetadataService, or am I missing something?The text was updated successfully, but these errors were encountered: