Share via


ITokenCacheSerializer Interface

Definition

This interface will be available in TokenCacheNotificationArgs callback to enable serialization/deserialization of the cache.

public interface ITokenCacheSerializer
type ITokenCacheSerializer = interface
Public Interface ITokenCacheSerializer
Derived

Remarks

The methods in this class are not thread safe. It is expected that they will be called from the token cache callbacks, registered via SetBeforeAccess, SetAfterAccess. These callbacks thread safe because they are triggered sequentially.

Methods

DeserializeAdalV3(Byte[])

Deserializes a part of the token cache - the refresh tokens - to the ADAL.NET 3.x cache format.
This API should only be used to maintain SSO between an application using ADAL 3.x and this application using MSAL 3.x or later. Use SerializeAdalV3()/DeserializeAdalV3(Byte[]) in addition to SerializeMsalV3()/DeserializeMsalV3(Byte[], Boolean).

See https://aka.ms/adal-to-msal-net/cache for details on how to use this advanced API correctly.

DeserializeMsalV2(Byte[])
Obsolete.

Deserializes the token cache to the MSAL.NET 2.x cache format, which is compatible with ADAL.NET v4 and other MSAL.NET v2 applications. If you need to maintain SSO between an application using ADAL 3.x or MSAL 2.x and this application using MSAL 3.x, you might also want to serialize and deserialize with SerializeAdalV3()/DeserializeAdalV3(Byte[]) or SerializeMsalV2()/DeserializeMsalV2(Byte[]), otherwise just use SerializeMsalV3()/DeserializeMsalV3(Byte[], Boolean).

DeserializeMsalV3(Byte[], Boolean)

Deserializes the token cache to the MSAL.NET 3.x cache format, which is compatible with other MSAL desktop libraries, including MSAL.NET 4.x, MSAL for Python and MSAL for Java. If you need to maintain SSO between an application using ADAL 3.x and this application using MSAL 3.x or later, you might also want to serialize and deserialize with SerializeAdalV3()/DeserializeAdalV3(Byte[]), otherwise just use SerializeMsalV3()/DeserializeMsalV3(Byte[], Boolean).

SerializeAdalV3()

Serializes a part of the token cache - the refresh tokens - to the ADAL.NET 3.x cache format. If you need to maintain SSO between an application using ADAL 3.x and this application using MSAL 3.x or later, use SerializeAdalV3()/DeserializeAdalV3(Byte[]) in addition to SerializeMsalV3()/DeserializeMsalV3(Byte[], Boolean).

See https://aka.ms/adal-to-msal-net/cache for details on how to use this advanced API correctly.

SerializeMsalV2()
Obsolete.

Serializes the token cache to the MSAL.NET 2.x unified cache format, which is compatible with ADAL.NET v4 and other MSAL.NET v2 applications. If you need to maintain SSO between an application using ADAL 3.x or MSAL 2.x and this application using MSAL 3.x, you might also want to serialize and deserialize with SerializeAdalV3()/DeserializeAdalV3(Byte[]) or SerializeMsalV2()/DeserializeMsalV2(Byte[]), otherwise just use SerializeMsalV3()/DeserializeMsalV3(Byte[], Boolean).

SerializeMsalV3()

Serializes the token cache to the MSAL.NET 3.x cache format, which is compatible with other MSAL desktop libraries, including MSAL.NET 4.x, MSAL for Python and MSAL for Java. If you need to maintain SSO between an application using ADAL 3.x and this application using MSAL 3.x or later, you might also want to serialize and deserialize with SerializeAdalV3()/DeserializeAdalV3(Byte[]), otherwise just use SerializeMsalV3()/DeserializeMsalV3(Byte[], Boolean).

Applies to