Federated identity management using Active Directory Federation Services
@Jay Myers
ADFS uses the Anchorclaim and the ClientID + a farm specific entropy value to generate the SHA256Digest value
for the SUB claim of an ID token.
It can happen though that the anchorclaim changes due to
a change of the AnchorClaimtype configuration on the claims provider trust itself
or
in some instances (often the change would occur sporadic from one logon to another) due to case sensitivity of the AnchorClaim value itself.
the later in particular occurs if the builtin AD Claims provider is used in that case the Windows LsaLookupCaches can become "polluted" by a user provided input. In particular if the anchorclaim is also used for the logon.
The LsaLookupCache entry my then be created with the value provided by the user
and when the Anchorclaim is populated Windows will not necessarily query from DS but fetches the value now from local Cache.
You may need to disable the cache by setting the following registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA
Name : LsaLookupCacheMaxSize
Type: Dword
Value: 0
additional informations about that caching behavior can be found in
https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/lsa-lookup-performance-counters#lsa-name-cache