-
Notifications
You must be signed in to change notification settings - Fork 408
Expand file tree
/
Copy pathAppAccessorWithPartitionAsserts.cs
More file actions
58 lines (48 loc) · 2.18 KB
/
Copy pathAppAccessorWithPartitionAsserts.cs
File metadata and controls
58 lines (48 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using Microsoft.Identity.Client;
using Microsoft.Identity.Client.Cache.Items;
using Microsoft.Identity.Client.Core;
using Microsoft.Identity.Client.PlatformsCommon.Shared;
using Microsoft.Identity.Lab.Api.Helpers;
namespace Microsoft.Identity.Lab.Api.Helpers
{
internal class AppAccessorWithPartitionAsserts : InMemoryPartitionedAppTokenCacheAccessor
{
public AppAccessorWithPartitionAsserts(
ILoggerAdapter logger,
CacheOptions tokenCacheAccessorOptions) : base(logger, tokenCacheAccessorOptions)
{
}
public override List<MsalAccessTokenCacheItem> GetAllAccessTokens(string partitionKey = null, ILoggerAdapter requestlogger = null)
{
Assert.IsNotNull(partitionKey);
return base.GetAllAccessTokens(partitionKey, requestlogger);
}
public override List<MsalAccountCacheItem> GetAllAccounts(string partitionKey = null, ILoggerAdapter requestlogger = null)
{
Assert.IsNotNull(partitionKey);
Assert.Fail("App token cache - do not call GetAllAccounts");
throw new InvalidOperationException();
}
public override List<MsalIdTokenCacheItem> GetAllIdTokens(string partitionKey = null, ILoggerAdapter requestlogger = null)
{
Assert.IsNotNull(partitionKey);
Assert.Fail("App token cache - do not call GetAllIdTokens");
throw new InvalidOperationException();
}
public override List<MsalRefreshTokenCacheItem> GetAllRefreshTokens(string partitionKey = null, ILoggerAdapter requestlogger = null)
{
Assert.IsNotNull(partitionKey);
Assert.Fail("App token cache - do not call GetAllRefreshTokens");
throw new InvalidOperationException();
}
public override bool HasAccessOrRefreshTokens()
{
Assert.Fail("HasAccessOrRefreshTokens was called. It should not be called unless the token cache serialization hooks");
throw new InvalidOperationException();
}
}
}