-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add public API to search in cache for Initiate long-running OBO (#4135)
* Add public API to search in cache for Initiate long-running OBO method. * Fix. * Move to extensibility class. Update comments. * Update comments. --------- Co-authored-by: Gladwin Johnson <[email protected]>
- Loading branch information
Showing
11 changed files
with
174 additions
and
24 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
35 changes: 35 additions & 0 deletions
35
...crosoft.Identity.Client/Extensibility/AcquireTokenOnBehalfOfParameterBuilderExtensions.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,35 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
|
||
namespace Microsoft.Identity.Client.Extensibility | ||
{ | ||
/// <summary> | ||
/// Extension methods for the <see cref="AcquireTokenOnBehalfOfParameterBuilder" /> | ||
/// </summary> | ||
public static class AcquireTokenOnBehalfOfParameterBuilderExtensions | ||
{ | ||
/// <summary> | ||
/// Only affects <see cref="ILongRunningWebApi.InitiateLongRunningProcessInWebApi(IEnumerable{string}, string, ref string)"/>. | ||
/// When enabled, mimics MSAL 4.50.0 and below behavior - checks in cache for cached tokens first, | ||
/// and if not found, then uses user assertion to request new tokens from AAD. | ||
/// When disabled (default behavior), doesn't search in cache, but uses the user assertion to retrieve tokens from AAD. | ||
/// </summary> | ||
/// <remarks> | ||
/// This method should only be used in specific cases for backwards compatibility. For most cases, rely on the default behavior | ||
/// of <see cref="ILongRunningWebApi.InitiateLongRunningProcessInWebApi(IEnumerable{string}, string, ref string)"/> and | ||
/// <see cref="ILongRunningWebApi.AcquireTokenInLongRunningProcess(IEnumerable{string}, string)"/> described in https://aka.ms/msal-net-long-running-obo . | ||
/// </remarks> | ||
/// <param name="builder"></param> | ||
/// <param name="searchInCache">Whether to search in cache.</param> | ||
/// <returns>The builder to chain the .With methods</returns> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public static AcquireTokenOnBehalfOfParameterBuilder WithSearchInCacheForLongRunningProcess(this AcquireTokenOnBehalfOfParameterBuilder builder, bool searchInCache = true) | ||
{ | ||
builder.Parameters.SearchInCacheForLongRunningObo = searchInCache; | ||
return builder; | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.