angular-auth-oidc-client icon indicating copy to clipboard operation
angular-auth-oidc-client copied to clipboard

[Bug]: Wellknown endpoints completely overwrite the authWellknownEndpoints configuration

Open dard0r opened this issue 1 year ago • 3 comments

Version

18.0.1

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

At the start of the login flow, the endpoints from the well-known configuration overwrite the `authWellknownEndpoints` object.

Steps to reproduce the behavior

No response

A clear and concise description of what you expected to happen.

The sessionStorage endpoints should be a merge of the well-known and the `authWellknownEndpoints` configuration object.

Additional context

This could be caused by the changes merged with PR #1922.

dard0r avatar Jul 15 '24 09:07 dard0r

Happened to me also in version 17 and 18. Something is overriding the authWellknownEndpoints in the storage with an empty object. Version 16 is ok.

amiram avatar Sep 30 '24 19:09 amiram

These lines from https://github.com/damienbod/angular-auth-oidc-client/commit/7b1577bda6d31fbe45d21bf6d2f8b6511665f008:

map((mappedWellKnownEndpoints) => ({
  ...mappedWellKnownEndpoints,
  ...authWellknownEndpoints,
}))

Seems to cause the newly fetched mappedWellKnownEndpoints to be overridden by the stored authWellknownEndpoints, so if the endpoints are changed on the server it doesn't get updated in the configuration.

patrikbjork avatar Oct 18 '24 10:10 patrikbjork

After #1922, authWellKownEndPoints kept in local storage started to be always replaced by the well-known endpoints returned by the server. The motivation for the change was that if server changed its endpoints, the cached values were never refreshed.

Now I'm seeing that change probably broke the authWellknownEndpoints option that I reckognise I was not aware of.

But now after #1984 we are faced with the original problem again: changed in the server will not be refreshed again as they are replaced by current values.

Maybe separating the value set via config to be cached in a different place than the value obtained from the server could be the solution. That way we'll be able to merge them always in the right way.

andsouto avatar Dec 02 '24 15:12 andsouto