| | | 1 | | |
| | | 2 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 3 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 4 | | |
| | | 5 | | using CoreWCF.IdentityModel.Tokens; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF.IdentityModel.Configuration |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Defines caches supported by IdentityModel for TokenReplay and SecuritySessionTokens |
| | | 11 | | /// </summary> |
| | | 12 | | public sealed class IdentityModelCaches |
| | | 13 | | { |
| | 10 | 14 | | private TokenReplayCache _tokenReplayCache = new DefaultTokenReplayCache(); |
| | 10 | 15 | | private SessionSecurityTokenCache _sessionSecurityTokenCache = new MruSessionSecurityTokenCache(); |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// Gets or sets the TokenReplayCache that is used to determine replayed token. |
| | | 19 | | /// </summary> |
| | | 20 | | public TokenReplayCache TokenReplayCache |
| | | 21 | | { |
| | | 22 | | get |
| | | 23 | | { |
| | 0 | 24 | | return _tokenReplayCache; |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | set |
| | | 28 | | { |
| | 0 | 29 | | if (value == null) |
| | | 30 | | { |
| | 0 | 31 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value)); |
| | | 32 | | } |
| | | 33 | | |
| | 0 | 34 | | _tokenReplayCache = value; |
| | 0 | 35 | | } |
| | | 36 | | } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Gets or sets the SessionSecurityTokenCache that is used to cache the <see cref="SessionSecurityToken"/> |
| | | 40 | | /// </summary> |
| | | 41 | | public SessionSecurityTokenCache SessionSecurityTokenCache |
| | | 42 | | { |
| | | 43 | | get |
| | | 44 | | { |
| | 2 | 45 | | return _sessionSecurityTokenCache; |
| | | 46 | | } |
| | | 47 | | |
| | | 48 | | set |
| | | 49 | | { |
| | 0 | 50 | | if (value == null) |
| | | 51 | | { |
| | 0 | 52 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(value)); |
| | | 53 | | } |
| | | 54 | | |
| | 0 | 55 | | _sessionSecurityTokenCache = value; |
| | 0 | 56 | | } |
| | | 57 | | } |
| | | 58 | | |
| | | 59 | | } |
| | | 60 | | } |