Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5498968
Initial commit. 2 TODOs
Robbie-Microsoft Aug 6, 2025
e04e408
Merge branch 'rginsburg/msiv2_feature_branch' into rginsburg/msiv2_csr
Robbie-Microsoft Aug 6, 2025
4e096b7
Merge branch 'rginsburg/msiv2_feature_branch' into rginsburg/msiv2_csr
Robbie-Microsoft Aug 6, 2025
6bc2164
Implemented CSR generator
Robbie-Microsoft Aug 6, 2025
762ccdf
first pass at improved unit tests
Robbie-Microsoft Aug 6, 2025
4ea6c09
Finished improving unit tests
Robbie-Microsoft Aug 6, 2025
009f948
Updates to CUID
Robbie-Microsoft Aug 7, 2025
21d4ef3
Unit test improvements
Robbie-Microsoft Aug 7, 2025
cd013a3
Implemented Feedback
Robbie-Microsoft Aug 7, 2025
480ae9e
renamed file
Robbie-Microsoft Aug 7, 2025
0aa8692
small improvement
Robbie-Microsoft Aug 8, 2025
621c566
added missing awaitor for async method
Robbie-Microsoft Aug 8, 2025
068461b
Fixed bugs discovered from unit testing in child branch
Robbie-Microsoft Aug 8, 2025
2034b25
undid changes to .proj
Robbie-Microsoft Aug 8, 2025
2b7486a
undid change to global.json
Robbie-Microsoft Aug 8, 2025
189ff9e
added missing sets
Robbie-Microsoft Aug 8, 2025
92b325f
Inplemented some feedback
Robbie-Microsoft Aug 11, 2025
067c83c
Implemented some feedback
Robbie-Microsoft Aug 14, 2025
f7d6f88
PKCS1 -> Pss padding
Robbie-Microsoft Aug 15, 2025
74e8e60
re-used imports
Robbie-Microsoft Aug 15, 2025
152f396
Implemented feedback
Robbie-Microsoft Aug 15, 2025
d46c853
Changes from manual testing.
Robbie-Microsoft Aug 19, 2025
3f75e3a
ImdsV2: Reworked Custom ASN1 Encoder to use System.Formats.Asn1 Nuget…
Robbie-Microsoft Aug 22, 2025
253993d
Merge branch 'rginsburg/msiv2_feature_branch' into rginsburg/msiv2_csr
Robbie-Microsoft Aug 22, 2025
3481c39
Implemented feedback
Robbie-Microsoft Aug 25, 2025
92158bb
Small rework due to spec changes
Robbie-Microsoft Aug 25, 2025
729a56a
Additional rework due to spec changes
Robbie-Microsoft Aug 25, 2025
3027392
Implemented feedback
Robbie-Microsoft Aug 25, 2025
3c3dcdf
Removed null check on vmId. Created CuidInfo.IsNullOrEmpty
Robbie-Microsoft Aug 25, 2025
f51cdf9
Implemented feedback
Robbie-Microsoft Aug 26, 2025
5e7ab07
Updated min version of imds, spec has incorrect info
Robbie-Microsoft Aug 26, 2025
362b407
Updated a comment
Robbie-Microsoft Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#if SUPPORTS_SYSTEM_TEXT_JSON
using JsonProperty = System.Text.Json.Serialization.JsonPropertyNameAttribute;
#else
using Microsoft.Identity.Client.Utils;
using Microsoft.Identity.Json;
#endif

namespace Microsoft.Identity.Client.ManagedIdentity
{
/// <summary>
/// Represents the response for a Managed Identity CSR request.
/// </summary>
internal class ClientCredentialRequestResponse
Comment thread
Robbie-Microsoft marked this conversation as resolved.
Outdated
{
[JsonProperty("client_id")]
public string ClientId { get; set; }

[JsonProperty("tenant_id")]
public string TenantId { get; set; }

[JsonProperty("client_credential")]
Comment thread
Robbie-Microsoft marked this conversation as resolved.
Outdated
public string ClientCredential { get; set; }

[JsonProperty("regional_token_url")]
public string RegionalTokenUrl { get; set; }

[JsonProperty("expires_in")]
public int ExpiresIn { get; set; }

[JsonProperty("refresh_in")]
public int RefreshIn { get; set; }

public ClientCredentialRequestResponse() { }

public static bool ValidateCsrRequestResponse(ClientCredentialRequestResponse clientCredentialRequestResponse)
Comment thread
Robbie-Microsoft marked this conversation as resolved.
Outdated
{
if (string.IsNullOrEmpty(clientCredentialRequestResponse.ClientId) ||
string.IsNullOrEmpty(clientCredentialRequestResponse.TenantId) ||
string.IsNullOrEmpty(clientCredentialRequestResponse.ClientCredential) ||
string.IsNullOrEmpty(clientCredentialRequestResponse.RegionalTokenUrl) ||
clientCredentialRequestResponse.ExpiresIn <= 0 ||
clientCredentialRequestResponse.RefreshIn <= 0)
{
return false;
}

return true;
}
}
}
Loading