-
Notifications
You must be signed in to change notification settings - Fork 379
Add extensibility APIs #5573
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
Open
neha-bhargava
wants to merge
21
commits into
main
Choose a base branch
from
nebharg/certExtensibility
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add extensibility APIs #5573
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
3c32188
Add extensibility APIs
neha-bhargava 2ea7e48
Merge branch 'main' into nebharg/certExtensibility
neha-bhargava dac7c01
Add functionality for retry and onSuccess.
neha-bhargava 303d8f2
Merge
neha-bhargava 17765a0
Fix build
neha-bhargava 9270a68
Apply suggestions from code review
neha-bhargava 9d28ea3
Merge branch 'main' into nebharg/certExtensibility
neha-bhargava c7363e0
Make the APIs experimental
neha-bhargava ef00c82
Merge branch 'main' into nebharg/certExtensibility
neha-bhargava 1f5b23a
Fix build failures in pipeline
neha-bhargava 463eb4e
Merge branch 'main' into nebharg/certExtensibility
neha-bhargava 107548e
Merge branch 'nebharg/certExtensibility' of https://github.com/AzureA…
neha-bhargava 037e52e
Fix tests
neha-bhargava 1a6b296
Merge branch 'main' into nebharg/certExtensibility
neha-bhargava 9fb9dc7
Update to use AssertionRequestOptions
neha-bhargava e8f7137
Merge conflicts
neha-bhargava 198de3f
Merge branch 'main' into nebharg/certExtensibility
neha-bhargava 20ce7bc
Resolve conflicts
neha-bhargava 745f44c
Merge branch 'nebharg/certExtensibility' of https://github.com/AzureA…
neha-bhargava 589a614
Fix build issue
neha-bhargava 6d303a9
Public API analyzers
neha-bhargava File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
42 changes: 42 additions & 0 deletions
42
src/client/Microsoft.Identity.Client/Extensibility/ClientCredentialExtensionParameters.cs
This file contains hidden or 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,42 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| namespace Microsoft.Identity.Client.Extensibility | ||
| { | ||
| /// <summary> | ||
| /// Provides application configuration context to client credential extensibility callbacks. | ||
| /// Contains read-only information about the confidential client application. | ||
| /// </summary> | ||
| #if !SUPPORTS_CONFIDENTIAL_CLIENT | ||
| [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] // hide confidential client on mobile | ||
| #endif | ||
| public class ClientCredentialExtensionParameters | ||
neha-bhargava marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| /// <summary> | ||
| /// Internal constructor - only MSAL can create instances of this class. | ||
| /// </summary> | ||
| /// <param name="config">The application configuration.</param> | ||
| internal ClientCredentialExtensionParameters(ApplicationConfiguration config) | ||
| { | ||
| ClientId = config.ClientId; | ||
| TenantId = config.TenantId; | ||
| Authority = config.Authority?.AuthorityInfo?.CanonicalAuthority?.ToString(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// The application (client) ID as registered in the Azure portal or application registration portal. | ||
| /// </summary> | ||
| public string ClientId { get; } | ||
|
|
||
| /// <summary> | ||
| /// The tenant ID if the application is configured for a specific tenant. | ||
| /// Will be null for multi-tenant applications. | ||
| /// </summary> | ||
| public string TenantId { get; } | ||
|
|
||
| /// <summary> | ||
| /// The authority URL used for authentication (e.g., https://login.microsoftonline.com/common). | ||
| /// </summary> | ||
| public string Authority { get; } | ||
| } | ||
| } | ||
This file contains hidden or 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
43 changes: 43 additions & 0 deletions
43
src/client/Microsoft.Identity.Client/Extensibility/ExecutionResult.cs
This file contains hidden or 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,43 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| namespace Microsoft.Identity.Client.Extensibility | ||
| { | ||
| /// <summary> | ||
| /// Represents the result of a token acquisition attempt. | ||
| /// Used by the execution observer configured via <see cref="ConfidentialClientApplicationBuilderExtensions.OnSuccess"/>. | ||
| /// </summary> | ||
| public class ExecutionResult | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this include the credential used (primarily care about the exact certificate used). If that information is in AuthenticationResult then that is fine. |
||
| { | ||
| /// <summary> | ||
| /// Internal constructor for ExecutionResult. | ||
| /// </summary> | ||
| internal ExecutionResult() { } | ||
|
|
||
| /// <summary> | ||
| /// Indicates whether the token acquisition was successful. | ||
| /// </summary> | ||
| /// <value> | ||
| /// <c>true</c> if the token was successfully acquired; otherwise, <c>false</c>. | ||
| /// </value> | ||
| public bool Successful { get; internal set; } | ||
|
|
||
| /// <summary> | ||
| /// The authentication result if the token acquisition was successful. | ||
| /// </summary> | ||
| /// <value> | ||
| /// An <see cref="AuthenticationResult"/> containing the access token and related metadata if <see cref="Successful"/> is <c>true</c>; | ||
| /// otherwise, <c>null</c>. | ||
| /// </value> | ||
| public AuthenticationResult Result { get; internal set; } | ||
|
|
||
| /// <summary> | ||
| /// The exception that occurred if the token acquisition failed. | ||
| /// </summary> | ||
| /// <value> | ||
| /// An <see cref="MsalException"/> describing the failure if <see cref="Successful"/> is <c>false</c>; | ||
| /// otherwise, <c>null</c>. | ||
| /// </value> | ||
| public MsalException Exception { get; internal set; } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.