diff --git a/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs b/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs index 6fb87dfca..75e9a7ce8 100644 --- a/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs +++ b/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs b/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs index 8339292a2..4068909d0 100644 --- a/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs +++ b/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs b/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs index 17cea241c..0f906f1a6 100644 --- a/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs +++ b/BFF/v2/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs b/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs index 6fb87dfca..75e9a7ce8 100644 --- a/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs +++ b/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs b/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs index 8339292a2..4068909d0 100644 --- a/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs +++ b/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs b/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs index f7805c11a..1865391f4 100644 --- a/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs +++ b/BFF/v3/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/BFF/v3/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs b/BFF/v3/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs index 6f4d9e4e0..e7cdda33a 100644 --- a/BFF/v3/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs +++ b/BFF/v3/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs @@ -26,7 +26,7 @@ public LoggedOut(IIdentityServerInteractionService interactionService, ILogger _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/BFF/v4/MultiFrontendSSO/MultiFrontendSSO.IdentityServer/Pages/Log.cs b/BFF/v4/MultiFrontendSSO/MultiFrontendSSO.IdentityServer/Pages/Log.cs index e5cff4a41..f5ffd2164 100644 --- a/BFF/v4/MultiFrontendSSO/MultiFrontendSSO.IdentityServer/Pages/Log.cs +++ b/BFF/v4/MultiFrontendSSO/MultiFrontendSSO.IdentityServer/Pages/Log.cs @@ -22,26 +22,26 @@ internal static class Log EventIds.ExternalClaims, "External claims: {Claims}"); - private static Action _noMatchingBackchannelLoginRequest = - LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = + LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id, null); + public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); - public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => _invalidBackchannelLoginId(logger, id, null); + public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); public static void ExternalClaims(this ILogger logger, IEnumerable claims) => _externalClaims(logger, claims, null); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) => _noMatchingBackchannelLoginRequest(logger, id, null); + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) => _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) => _noConsentMatchingRequest(logger, returnUrl, null); + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) => _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } internal static class EventIds diff --git a/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs b/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs index d0a8cb4b9..dca838d9d 100644 --- a/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs +++ b/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Consent.cshtml.cs @@ -58,7 +58,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -125,7 +125,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs b/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs index 66e7a077a..53b73b42e 100644 --- a/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs +++ b/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Ciba/Index.cshtml.cs @@ -30,7 +30,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs b/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs index fb35f67a9..b4d62c1c7 100644 --- a/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs +++ b/BFF/v4/TokenExchange/TokenExchange.IdentityServer/Pages/Consent/Index.cshtml.cs @@ -131,7 +131,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/BFF/v4/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs b/BFF/v4/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs index e58e0dfaf..434712cee 100644 --- a/BFF/v4/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs +++ b/BFF/v4/docker/ContainerizedIdentityServer/Pages/Account/Logout/LoggedOut.cshtml.cs @@ -26,7 +26,7 @@ public LoggedOut(IIdentityServerInteractionService interactionService, ILogger _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs b/IdentityServer/v7/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs index 97103b343..91a8d71c8 100644 --- a/IdentityServer/v7/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs +++ b/IdentityServer/v7/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs @@ -10,7 +10,7 @@ internal static class Log EventIds.InvalidId, "Invalid id {Id}"); - public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id, null); + public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -19,7 +19,7 @@ internal static class Log "Invalid backchannel login id {Id}"); public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -30,22 +30,22 @@ public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => public static void ExternalClaims(this ILogger logger, IEnumerable claims) => _externalClaims(logger, claims, null); - private static Action _noMatchingBackchannelLoginRequest = - LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = + LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) => - _noMatchingBackchannelLoginRequest(logger, id, null); + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) => + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) => - _noConsentMatchingRequest(logger, returnUrl, null); + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) => + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } internal static class EventIds diff --git a/IdentityServer/v7/Configuration/IdentityServerHost/Pages/Log.cs b/IdentityServer/v7/Configuration/IdentityServerHost/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v7/Configuration/IdentityServerHost/Pages/Log.cs +++ b/IdentityServer/v7/Configuration/IdentityServerHost/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Diagnostics/Aspire/IdentityServer/Pages/Log.cs b/IdentityServer/v7/Diagnostics/Aspire/IdentityServer/Pages/Log.cs index 12356debb..280ad4f83 100644 --- a/IdentityServer/v7/Diagnostics/Aspire/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/Diagnostics/Aspire/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs index 3b3b1ad86..b880603e4 100644 --- a/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs index e4fd94502..5d19a904c 100644 --- a/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs index ca7726408..aec8269c2 100644 --- a/IdentityServer/v7/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs index 81087f76f..4d81c52b2 100644 --- a/IdentityServer/v7/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 71c99a23e..0056bec98 100644 --- a/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/McpDemo/McpDemo.IdentityServer/Pages/Log.cs b/IdentityServer/v7/McpDemo/McpDemo.IdentityServer/Pages/Log.cs index f8a74dfa0..18fa41f3e 100644 --- a/IdentityServer/v7/McpDemo/McpDemo.IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/McpDemo/McpDemo.IdentityServer/Pages/Log.cs @@ -7,7 +7,7 @@ internal static class Log EventIds.InvalidId, "Invalid id {Id}"); - public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id, null); + public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -16,7 +16,7 @@ internal static class Log "Invalid backchannel login id {Id}"); public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -27,22 +27,22 @@ public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => public static void ExternalClaims(this ILogger logger, IEnumerable claims) => _externalClaims(logger, claims, null); - private static Action _noMatchingBackchannelLoginRequest = - LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = + LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) => - _noMatchingBackchannelLoginRequest(logger, id, null); + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) => + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) => - _noConsentMatchingRequest(logger, returnUrl, null); + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) => + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } internal static class EventIds diff --git a/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index c7ea998c6..9ff57ae9d 100644 --- a/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs index f0301d9a6..f3803f65b 100644 --- a/IdentityServer/v7/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs b/IdentityServer/v7/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v7/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs b/IdentityServer/v7/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v7/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs b/IdentityServer/v7/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v7/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs b/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs b/IdentityServer/v7/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs index 314f4095a..ca38ad418 100644 --- a/IdentityServer/v7/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs +++ b/IdentityServer/v7/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs b/IdentityServer/v7/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v7/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs b/IdentityServer/v7/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v7/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v7/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 71c99a23e..0056bec98 100644 --- a/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/SessionMigration/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/SessionMigration/Pages/Ciba/Consent.cshtml.cs index 5fbc85ee9..f9bef6db2 100644 --- a/IdentityServer/v7/SessionMigration/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/SessionMigration/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/SessionMigration/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/SessionMigration/Pages/Ciba/Index.cshtml.cs index 4af227a9b..a53a6a8ae 100644 --- a/IdentityServer/v7/SessionMigration/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/SessionMigration/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } diff --git a/IdentityServer/v7/SessionMigration/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/SessionMigration/Pages/Consent/Index.cshtml.cs index 399fc0bb9..9c6c6b756 100644 --- a/IdentityServer/v7/SessionMigration/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/SessionMigration/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 71c99a23e..0056bec98 100644 --- a/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 71c99a23e..0056bec98 100644 --- a/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 71c99a23e..0056bec98 100644 --- a/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index f22b496c3..21dda2e49 100644 --- a/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index ea44e3d81..b019d3658 100644 --- a/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } diff --git a/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs index deb27d7fc..5085e0abc 100644 --- a/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 71c99a23e..0056bec98 100644 --- a/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 4a8e5d99a..54b5198c0 100644 --- a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 498b03c8f..d90777915 100644 --- a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 71c99a23e..0056bec98 100644 --- a/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v7/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs b/IdentityServer/v8/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs index 97103b343..91a8d71c8 100644 --- a/IdentityServer/v8/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs +++ b/IdentityServer/v8/AspNetIdentityPasskeys/IdentityServerAspNetIdentityPasskeys/Pages/Log.cs @@ -10,7 +10,7 @@ internal static class Log EventIds.InvalidId, "Invalid id {Id}"); - public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id, null); + public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -19,7 +19,7 @@ internal static class Log "Invalid backchannel login id {Id}"); public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -30,22 +30,22 @@ public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => public static void ExternalClaims(this ILogger logger, IEnumerable claims) => _externalClaims(logger, claims, null); - private static Action _noMatchingBackchannelLoginRequest = - LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = + LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) => - _noMatchingBackchannelLoginRequest(logger, id, null); + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) => + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) => - _noConsentMatchingRequest(logger, returnUrl, null); + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) => + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } internal static class EventIds diff --git a/IdentityServer/v8/Configuration/IdentityServerHost/Pages/Log.cs b/IdentityServer/v8/Configuration/IdentityServerHost/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v8/Configuration/IdentityServerHost/Pages/Log.cs +++ b/IdentityServer/v8/Configuration/IdentityServerHost/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Diagnostics/Aspire/IdentityServer/Pages/Log.cs b/IdentityServer/v8/Diagnostics/Aspire/IdentityServer/Pages/Log.cs index 12356debb..280ad4f83 100644 --- a/IdentityServer/v8/Diagnostics/Aspire/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/Diagnostics/Aspire/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs index 970ddbfd7..e76d7d0b1 100644 --- a/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs index 25e5988fa..eb31f2853 100644 --- a/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/Diagnostics/Otel/src/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs index a1358d958..f173ad5d0 100644 --- a/IdentityServer/v8/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/Diagnostics/Otel/src/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/IdentityServerHost/src/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs index 1ca8da6f1..5421c99ae 100644 --- a/IdentityServer/v8/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/IdentityServerHost/src/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 89196e65d..9f3882f42 100644 --- a/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/MTLS/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/McpDemo/McpDemo.IdentityServer/Pages/Log.cs b/IdentityServer/v8/McpDemo/McpDemo.IdentityServer/Pages/Log.cs index f8a74dfa0..18fa41f3e 100644 --- a/IdentityServer/v8/McpDemo/McpDemo.IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/McpDemo/McpDemo.IdentityServer/Pages/Log.cs @@ -7,7 +7,7 @@ internal static class Log EventIds.InvalidId, "Invalid id {Id}"); - public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id, null); + public static void InvalidId(this ILogger logger, string? id) => _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -16,7 +16,7 @@ internal static class Log "Invalid backchannel login id {Id}"); public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -27,22 +27,22 @@ public static void InvalidBackchannelLoginId(this ILogger logger, string? id) => public static void ExternalClaims(this ILogger logger, IEnumerable claims) => _externalClaims(logger, claims, null); - private static Action _noMatchingBackchannelLoginRequest = - LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = + LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) => - _noMatchingBackchannelLoginRequest(logger, id, null); + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) => + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) => - _noConsentMatchingRequest(logger, returnUrl, null); + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) => + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } internal static class EventIds diff --git a/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 2b770d6f3..017f9a404 100644 --- a/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/PAT/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 7635f6f48..60c74aa33 100644 --- a/IdentityServer/v8/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/PAT/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs b/IdentityServer/v8/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v8/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/Quickstarts/2_InteractiveAspNetCore/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs b/IdentityServer/v8/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v8/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/Quickstarts/3_AspNetCoreAndApis/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs b/IdentityServer/v8/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v8/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/Quickstarts/3a_TokenManagement/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs b/IdentityServer/v8/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v8/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/Quickstarts/4_EntityFramework/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs b/IdentityServer/v8/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs index 314f4095a..ca38ad418 100644 --- a/IdentityServer/v8/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs +++ b/IdentityServer/v8/Quickstarts/5_AspNetIdentity/src/IdentityServerAspNetIdentity/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs b/IdentityServer/v8/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v8/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/Quickstarts/6_JS_with_backend/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs b/IdentityServer/v8/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs index 211690a0c..ecaf989f1 100644 --- a/IdentityServer/v8/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs +++ b/IdentityServer/v8/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Log.cs @@ -12,7 +12,7 @@ internal static class Log public static void InvalidId(this ILogger logger, string? id) { - _invalidId(logger, id, null); + _invalidId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static readonly Action _invalidBackchannelLoginId = LoggerMessage.Define( @@ -22,7 +22,7 @@ public static void InvalidId(this ILogger logger, string? id) public static void InvalidBackchannelLoginId(this ILogger logger, string? id) { - _invalidBackchannelLoginId(logger, id, null); + _invalidBackchannelLoginId(logger, id?.ReplaceLineEndings(string.Empty), null); } private static Action, Exception?> _externalClaims = LoggerMessage.Define>( @@ -35,24 +35,24 @@ public static void ExternalClaims(this ILogger logger, IEnumerable claim _externalClaims(logger, claims, null); } - private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( + private static Action _noMatchingBackchannelLoginRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoMatchingBackchannelLoginRequest, "No backchannel login request matching id: {Id}"); - public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string id) + public static void NoMatchingBackchannelLoginRequest(this ILogger logger, string? id) { - _noMatchingBackchannelLoginRequest(logger, id, null); + _noMatchingBackchannelLoginRequest(logger, id?.ReplaceLineEndings(string.Empty), null); } - private static Action _noConsentMatchingRequest = LoggerMessage.Define( + private static Action _noConsentMatchingRequest = LoggerMessage.Define( LogLevel.Error, EventIds.NoConsentMatchingRequest, "No consent request matching request: {ReturnUrl}"); - public static void NoConsentMatchingRequest(this ILogger logger, string returnUrl) + public static void NoConsentMatchingRequest(this ILogger logger, string? returnUrl) { - _noConsentMatchingRequest(logger, returnUrl, null); + _noConsentMatchingRequest(logger, returnUrl?.ReplaceLineEndings(string.Empty), null); } diff --git a/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 1ca8da6f1..5421c99ae 100644 --- a/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/SAML/Basic/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 1ca8da6f1..5421c99ae 100644 --- a/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/SAML/IdPInitiated/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 89196e65d..9f3882f42 100644 --- a/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/SessionManagement/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/SessionMigration/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/SessionMigration/Pages/Ciba/Consent.cshtml.cs index 42f8bd80f..9c57fda10 100644 --- a/IdentityServer/v8/SessionMigration/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/SessionMigration/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/SessionMigration/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/SessionMigration/Pages/Ciba/Index.cshtml.cs index a6a630d2f..62bb204e6 100644 --- a/IdentityServer/v8/SessionMigration/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/SessionMigration/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } diff --git a/IdentityServer/v8/SessionMigration/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/SessionMigration/Pages/Consent/Index.cshtml.cs index af4563951..640621608 100644 --- a/IdentityServer/v8/SessionMigration/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/SessionMigration/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 89196e65d..9f3882f42 100644 --- a/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/Ciba/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 89196e65d..9f3882f42 100644 --- a/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/DynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 89196e65d..9f3882f42 100644 --- a/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/ProfileService/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index b7504e2a1..36062543e 100644 --- a/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 2504a8021..ed67dadd0 100644 --- a/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } diff --git a/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs index bd81ae99b..4d3b78067 100644 --- a/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/StepUp/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 89196e65d..9f3882f42 100644 --- a/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/WindowsAuthentication/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index e0667aa11..83a9d4709 100644 --- a/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -57,7 +57,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -124,7 +124,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index 7c00d0134..5dfa4edef 100644 --- a/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -29,7 +29,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs index 89196e65d..9f3882f42 100644 --- a/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/IdentityServer/v8/UserInteraction/WsFederationDynamicProviders/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -130,7 +130,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/IdentityServer/v8/UserManagement/FullSample/UserManagementSample/Pages/Consent.cshtml.cs b/IdentityServer/v8/UserManagement/FullSample/UserManagementSample/Pages/Consent.cshtml.cs index a3256f3c3..45def6b3e 100644 --- a/IdentityServer/v8/UserManagement/FullSample/UserManagementSample/Pages/Consent.cshtml.cs +++ b/IdentityServer/v8/UserManagement/FullSample/UserManagementSample/Pages/Consent.cshtml.cs @@ -121,7 +121,7 @@ private async Task SetViewModelAsync(string? returnUrl) return true; } - logger.LogWarning("No consent request matching request: {ReturnUrl}", returnUrl); + logger.LogWarning("No consent request matching request: {ReturnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); return false; } diff --git a/various/clients/Owin/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs b/various/clients/Owin/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs index 864efec85..4d9642b8f 100644 --- a/various/clients/Owin/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs +++ b/various/clients/Owin/IdentityServerHost/Pages/Ciba/Consent.cshtml.cs @@ -64,7 +64,7 @@ public async Task OnPost() var request = await _interaction.GetLoginRequestByInternalIdAsync(Input.Id, HttpContext.RequestAborted); if (request == null || request.Subject.GetSubjectId() != User.GetSubjectId()) { - _logger.LogError("Invalid id {id}", Input.Id); + _logger.LogError("Invalid id {id}", Input.Id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/Home/Error/Index"); } @@ -131,7 +131,7 @@ private async Task BuildViewModelAsync(string id, InputModel model = } else { - _logger.LogError("No backchannel login request matching id: {id}", id); + _logger.LogError("No backchannel login request matching id: {id}", id?.ReplaceLineEndings(string.Empty)); } return null; } diff --git a/various/clients/Owin/IdentityServerHost/Pages/Ciba/Index.cshtml.cs b/various/clients/Owin/IdentityServerHost/Pages/Ciba/Index.cshtml.cs index fad94a092..997d48065 100644 --- a/various/clients/Owin/IdentityServerHost/Pages/Ciba/Index.cshtml.cs +++ b/various/clients/Owin/IdentityServerHost/Pages/Ciba/Index.cshtml.cs @@ -33,7 +33,7 @@ public async Task OnGet(string id) LoginRequest = await _backchannelAuthenticationInteraction.GetLoginRequestByInternalIdAsync(id, HttpContext.RequestAborted); if (LoginRequest == null) { - _logger.LogWarning("Invalid backchannel login id {id}", id); + _logger.LogWarning("Invalid backchannel login id {id}", id?.ReplaceLineEndings(string.Empty)); return RedirectToPage("/home/error/index"); } diff --git a/various/clients/Owin/IdentityServerHost/Pages/Consent/Index.cshtml.cs b/various/clients/Owin/IdentityServerHost/Pages/Consent/Index.cshtml.cs index b28f15b6a..4420faa30 100644 --- a/various/clients/Owin/IdentityServerHost/Pages/Consent/Index.cshtml.cs +++ b/various/clients/Owin/IdentityServerHost/Pages/Consent/Index.cshtml.cs @@ -140,7 +140,7 @@ private async Task BuildViewModelAsync(string returnUrl, InputModel m } else { - _logger.LogError("No consent request matching request: {0}", returnUrl); + _logger.LogError("No consent request matching request: {returnUrl}", returnUrl?.ReplaceLineEndings(string.Empty)); } return null; }