Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeLoadException #4792

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -7,10 +7,11 @@

namespace Microsoft.Identity.Client.Extensibility
{

/// <summary>
/// Extensions for all AcquireToken methods
/// </summary>
public static partial class AbstractConfidentialClientAcquireTokenParameterBuilderExtension
public static class AbstractConfidentialClientAcquireTokenParameterBuilderExtension
{
/// <summary>
/// Intervenes in the request pipeline, by executing a user provided delegate before MSAL makes the token request.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.ComponentModel;

namespace Microsoft.Identity.Client.Extensibility
{
/// <summary>
///
/// </summary>
public static class AcquireTokenForClientBuilderExtensions
{
/// <summary>
/// Binds the token to a key in the cache. L2 cache keys contain the key id.
/// No cryptographic operations is performed on the token.
/// </summary>
/// <param name="builder"></param>
/// <param name="keyId">A key id to which the access token is associated. The token will not be retrieved from the cache unless the same key id is presented. Can be null.</param>
/// <param name="expectedTokenTypeFromAad">AAD issues several types of bound tokens. MSAL checks the token type, which needs to match the value set by ESTS. Normal POP tokens have this as "pop"</param>
/// <returns>the builder</returns>
[EditorBrowsable(EditorBrowsableState.Never)] // https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/4789
public static AcquireTokenForClientParameterBuilder WithProofOfPosessionKeyId(
this AcquireTokenForClientParameterBuilder builder,
string keyId,
string expectedTokenTypeFromAad = "Bearer")
{
if (string.IsNullOrEmpty(keyId))
{
throw new ArgumentNullException(nameof(keyId));
}

builder.ValidateUseOfExperimentalFeature();
builder.CommonParameters.AuthenticationScheme = new ExternalBoundTokenScheme(keyId, expectedTokenTypeFromAad);

return builder;
}
}
}