Table of Contents

Class OidcLogSanitizer

Namespace
SEBT.Portal.Core.Utilities
Assembly
SEBT.Portal.Core.dll

Truncates and strips control characters from OIDC error strings before logging. IdP error_description values may be long URL-encoded JSON blobs.

public static class OidcLogSanitizer
Inheritance
object
OidcLogSanitizer

Fields

MaxDescriptionLength

Max length for error_description and similar fields in logs.

public const int MaxDescriptionLength = 500

Field Value

int

MaxErrorCodeLength

Max length for short OAuth error codes (e.g. invalid_grant).

public const int MaxErrorCodeLength = 128

Field Value

int

Methods

Sanitize(string?, int)

Strips CR/LF and truncates for safe structured logging.

public static string Sanitize(string? value, int maxLength = 500)

Parameters

value string
maxLength int

Returns

string