Trending issue with Distributed Cache and July 2026

UPDATE: This issue is fixed by the August 2026 updates.

The July 2026 update was released July 14, 2026. This introduced many security fixes but this can cause issues with your SAML, OIDC, or FBA implementations. This can prevent tokens from being added or read from dcache.

Here are some logs from my 2019 farm:
07/18/2026 12:18:03.74 w3wp.exe (0x0FF8) 0x1914 SharePoint Foundation DistributedCache air38 Medium Token Cache: Failed to add token from distributed cache. Key: ‘0e.t|microsoftentratrust|user1@TestTestTest.onmicrosoft.com’, Exception: ‘System.NotSupportedException: Specified method is not supported. at Microsoft.SharePoint.IdentityModel.SPTokenCache.NotSupportedCookieTransform.Encode(Byte[] value) at Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.ApplyTransforms(Byte[] cookie, Boolean outbound) at Microsoft.IdentityModel.Tokens.SessionSecurityTokenHandler.WriteToken(XmlWriter writer, SecurityToken token) at Microsoft.IdentityModel.Tokens.SecurityTokenSerializerAdapter.WriteTokenCore(XmlWriter writer, SecurityToken token) at Microsoft.SharePoint.Administration.Claims.SPTokenCacheEntry.SerializeToken(SecurityTokenSerializer tokenSerializer) at Microsoft.SharePoint.IdentityModel.SPDistributedSecurityTokenCache.Put(String key, Object value) at Microsoft.SharePoint.IdentityModel.SPTokenCache.AddCachedTokenV1(String cachekey, SPTokenCacheEntry value)’. 908628a2-2a7c-10e3-545f-1f5de6df25d3

07/18/2026 12:18:03.74 w3wp.exe (0x0FF8) 0x1914 SharePoint Foundation DistributedCache air39 Medium Token Cache: Reverting to local cache to Add the token. Key: ‘0e.t|microsoftentratrust|user1@TestTestTest.onmicrosoft.com’. 908628a2-2a7c-10e3-545f-1f5de6df25d3

Log entry from SPSE:
07/23/2026 14:34:31.14 w3wp.exe (0x6128) 0x2814 SharePoint Foundation DistributedCache aa6e6 Unexpected Unexpected error in ByteArrayToObject – Exception ‘System.NotSupportedException: Specified method is not supported. at Microsoft.SharePoint.IdentityModel.SPSessionSecurityTokenHandlerV2.ReadToken(XmlReader reader) at System.IdentityModel.Tokens.SecurityTokenHandlerCollection.ReadToken(XmlReader reader) at Microsoft.SharePoint.Administration.Claims.SPTokenCacheEntry..ctor(SerializationInfo info, StreamingContext context) at ReadSPTokenCacheEntryFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader) at Microsoft.SharePoint.DistributedCaching.SPDistributedCacheUtils.ByteArrayToObject[T](Byte[] Buffer)’.

The PG is currently investigating the issue above and hoping to get a fix sooner than later. I would suggest using sticky sessions or persistence at your NLB. Failing to read a token from the dcache will fall back to the local cache(the STS). If the request hits a different WFE than the one you and the token is unable to be located (dcache and local), SharePoint invalidates the clients FedAuth cookie and makes them reauthenticate.

AuthProviderTypeChangeEnabled – Preventing migrations in User Profile Synchronization

There is new logic in the User Profile Service Application that will prevent user migration between authentication providers. This means no more migrating from Windows to Trusted Identity Provider or Trusted Identity Provider during User Profile Sync.

This is only available for SharePoint Subscription Edition(SE) and SharePoint 2019 with February 2023 CU.

AuthProviderTypeChangeEnabled is set to false out of the box. If you have Windows user profiles and want to sync them as SAML, the sync will not happen for those profiles. The ULS log entry will show during the sync:

05/27/2023 07:08:09.17        OWSTIMER.EXE (0x3094)        0x4C64        SharePoint Portal Server        User Profiles        4ytvv        High        Trying to migrate account from ‘contoso\User1’ to ‘i:0e.t|ContosoAdfs|user1@contoso.com’, which is not allowed because the authentication provider type is changed.        e56b4303-927d-43eb-a9ac-8f47d92fe65c

To change the property to true we need to do that at the UPA’s proxy:

$upaproxy = Get-SPServiceApplicationProxy | ? {$_.typename -eq "User Profile Service Application Proxy"}
$upaproxy.AuthProviderTypeChangeEnabled = $true
$upaproxy.Update()

I would suggest running the sync and flipping the property back to $false to prevent migrations.

SharePoint – Security Trimmed list of sites

I was recently asked about getting a list of site collections that the users would have permissions to (security trimmed). The first thought was utilizing search since we would want to security trim the list.

1. Edit the Modern page

2. Add in the Highlighted Content Web part

3. Edit the Web Part

4. This will show many options on the right side of the page. We want to leave it on Filter. Next, we want to select Selected sites or All sites. Depending on if you would like to consider all the site collections in your tenant.

5. Change the Type from Documents to Pages.

6. The Filter selection needs to be changed to Managed property. More on managed properties here: https://docs.microsoft.com/en-us/sharepoint/manage-search-schema

7. In the Find a managed property, enter in content. Then select ContentClass, Equals, STS_Site. We could look for Subsites within site collection(s) by using STS_Web.

8. After this is done, you can see the web part update in real time. This will show the sites (items) only if that user has permission.

PowerShell Script: Check user profiles

I have been asked many times how to check if Active Directory Import is working. With User Profile Synchronization, we had the FIM client to show what was updated during the MOSS_Export step.

The script I wrote uses DirSync which allows for incremental checks against Active Directory. This will create a cookie.bin that will keep track of state of AD when you ran it last. The account we would like to use is the same account you’d use sync user profiles.

The service account we would need to run this with your sync account that will connect to Active Directory with Replicate Directory Changes.

Adjust the script to match your environment. Be sure to add the mappings.xml file to the folder specified on Line 11.


Mappings

Mappings can be added or subtracted from the mappings.xml file that is included. This file is needed to know what we would like to check from AD to SharePoint. When adding in additional mappings, be sure to match the internal name(s) of the profile properties.


Results

The script will out put a CSV with tab as the delimiter character. This will allow easier sorting to troubleshoot the specific user profile. UPA Value column is what the user profile has


For a good troubleshooting guide user profiles not syncing check out my colleague Josh’s guide: https://joshroark.com/sharepoint-all-about-non-imported-user-profiles/

Download the script here

SharePoint SAML Migration Guide – Part 5 User Profiles

SharePoint SAML Migration Guide – Part 1 Planning

SharePoint SAML Migration Guide – Part 2 Trusted Identity

SharePoint SAML Migration Guide – Part 3 Migration

SharePoint SAML Migration Guide – Part 4 Web Applications

SharePoint SAML Migration Guide – Part 5 User Profiles

The User Profiles are usually overlooked when migrating to SAML. This will require a new connection to be recreated if you’re using Active Directory Import (ADI) or User Profile Synchronization Service (2013/2010).

Recreating the connection will require some documentation before deleting the old connection. FQDN of forest connection, Service Account, Connection Filter/LDAP Filter, OU Selection, User Profile Property Mappings

ADI or User Profile Synchronization Service

Back in Part 1 of this guide we decided on a claim identifier. This is key when setting up your user profiles. First we’re going to create a new connection and give it a name.

Make sure to select Trusted Claims Provider Authentication as the Authentication Provider Type. If you have more than one provider, select the correct one for Authentication Provider Instance.


After creating the connection, we need to map the claim identifier. Back in the User Profile Service Application, we need to select Manage User Properties.


Click on the drop down for Claim User Identifier and Edit.


I’m using email as my identifier, so I’m entering in the AD property of ‘mail’. Adjust this to match your identifier. Click Add. Repeat for other connections/domains.


Click OK and kick off a full sync.

Users with a claim identifier will be imported and shown now as a SAML user profile


Using Full MIM with SharePoint 2016/2019? Check out my post here about setting this up. https://adamsorenson.com/sharepoint-2016-mim-and-samlfba-user-profiles/

Oauth with Roles/Group membership not working? Check out my post here about that subject: https://adamsorenson.com/saml-roles-and-sharepoint-20162013-with-oauth/