-
Notifications
You must be signed in to change notification settings - Fork 403
Expand file tree
/
Copy pathAcquireTokenForManagedIdentityParameters.cs
More file actions
61 lines (51 loc) · 2.25 KB
/
AcquireTokenForManagedIdentityParameters.cs
File metadata and controls
61 lines (51 loc) · 2.25 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
59
60
61
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Identity.Client.Core;
using Microsoft.Identity.Client.ManagedIdentity;
namespace Microsoft.Identity.Client.ApiConfig.Parameters
{
internal class AcquireTokenForManagedIdentityParameters : IAcquireTokenParameters
{
public bool ForceRefresh { get; set; }
public string Resource { get; set; }
public string Claims { get; set; }
/// <summary>
/// Client-originated claims to be sent to the identity endpoint.
/// Unlike <see cref="Claims"/> (server-issued), these are cached and keyed on the claims value.
/// </summary>
public string ClientClaims { get; set; }
public string RevokedTokenHash { get; set; }
public bool IsMtlsPopRequested { get; set; }
internal X509Certificate2 MtlsCertificate { get; set; }
/// <summary>
/// Optional delegate for obtaining attestation JWT for Credential Guard keys.
/// Set by the KeyAttestation package via .WithAttestationSupport().
/// Signature: (endpoint, keyHandle, clientId, keyId, logger, cancellationToken) → JWT or null.
/// </summary>
public Func<string, SafeHandle, string, string, ILoggerAdapter, CancellationToken, Task<string>> AttestationTokenProvider { get; set; }
public void LogParameters(ILoggerAdapter logger)
{
if (logger.IsLoggingEnabled(LogLevel.Info))
{
logger.Info(
$"""
=== AcquireTokenForManagedIdentityParameters ===
ForceRefresh: {ForceRefresh}
Resource: {Resource}
Claims: {!string.IsNullOrEmpty(Claims)}
ClientClaims: {!string.IsNullOrEmpty(ClientClaims)}
RevokedTokenHash: {!string.IsNullOrEmpty(RevokedTokenHash)}
IsMtlsPopRequested: {IsMtlsPopRequested}
""");
}
}
}
}