-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for 3000 - improve error messages when credentials fail to load (#…
…3003) * Fix for 3000 - logging for loading credentials into MSAL and minor for MSI+FIC * revert msal bump * Address comment * Fix a nullable warning * Updating a few files used to test --------- Co-authored-by: Jean-Marc Prieur <[email protected]>
- Loading branch information
Showing
16 changed files
with
552 additions
and
43 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/Microsoft.Identity.Web.Certificate/DefaultCredentialsLoader.Logger.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,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Identity.Abstractions; | ||
using System; | ||
|
||
namespace Microsoft.Identity.Web | ||
{ | ||
// Log messages for DefaultCredentialsLoader | ||
public partial class DefaultCredentialsLoader | ||
{ | ||
/// <summary> | ||
/// Logging infrastructure | ||
/// </summary> | ||
private static class Logger | ||
{ | ||
private static readonly Action<ILogger, string, string, bool, Exception?> s_credentialLoadingFailure = | ||
LoggerMessage.Define<string, string, bool>( | ||
LogLevel.Information, | ||
new EventId( | ||
7, | ||
nameof(CredentialLoadingFailure)), | ||
"Failed to load credential {id} from source {sourceType}. Will it be skipped in the future ? {skip}."); | ||
|
||
public static void CredentialLoadingFailure(ILogger logger, CredentialDescription cd, Exception? ex) | ||
=> s_credentialLoadingFailure(logger, cd.Id, cd.SourceType.ToString(), cd.Skip, ex); | ||
} | ||
} | ||
} |
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.