-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preview implementation for proof of possession token support (#41015)
- Loading branch information
1 parent
8a199b8
commit ff6ce56
Showing
32 changed files
with
707 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
sdk/core/Azure.Core.Experimental/src/ISupportsProofOfPossession.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Azure.Core | ||
{ | ||
/// <summary> | ||
/// An interface used to decorate a <see cref="TokenCredential"/> that supports <see href="https://learn.microsoft.com/entra/msal/dotnet/advanced/proof-of-possession-tokens">Proof of Possession tokens</see> for authenticating to Microsoft Entra ID. | ||
/// </summary> | ||
public interface ISupportsProofOfPossession | ||
{ | ||
/// <summary> | ||
/// Gets an <see cref="AccessToken"/> for the specified set of scopes. | ||
/// </summary> | ||
/// <param name="requestContext">The <see cref="PopTokenRequestContext"/> with authentication information.</param> | ||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param> | ||
/// <returns>A valid <see cref="AccessToken"/>.</returns> | ||
/// <remarks>Caching and management of the lifespan for the <see cref="AccessToken"/> is considered the responsibility of the caller. Each call should request a fresh token.</remarks> | ||
public ValueTask<AccessToken> GetTokenAsync(PopTokenRequestContext requestContext, CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Gets an <see cref="AccessToken"/> for the specified set of scopes. | ||
/// </summary> | ||
/// <param name="requestContext">The <see cref="PopTokenRequestContext"/> with authentication information.</param> | ||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param> | ||
/// <returns>A valid <see cref="AccessToken"/>.</returns> | ||
/// <remarks>Caching and management of the lifespan for the <see cref="AccessToken"/> is considered the responsibility of the caller. Each call should request a fresh token.</remarks> | ||
public AccessToken GetToken(PopTokenRequestContext requestContext, CancellationToken cancellationToken); | ||
} | ||
} |
Oops, something went wrong.