AzureAD / azure-activedirectory-identitymodel-extensions-for-dotnet

IdentityModel extensions for .Net
MIT License
1.06k stars 401 forks source link

[Bug] Exception message includes stacktrace #2761

Open marekvinkler opened 2 months ago

marekvinkler commented 2 months ago

Which version of Microsoft.IdentityModel are you using? Microsoft.IdentityModel.Protocols 8.0.1

Where is the issue?

Is this a new or an existing app? a. The app is in production and I have upgraded to a new version of Microsoft.IdentityModel.*

Repro Use a non-existent metadata address in ConfigurationManager.

Expected behavior The exception message contains just the messages, no stack trace.

Actual behavior The exception messages contain also stack traces.

Possible solution Use only exception.Message, not exception.ToString() when creating the nested exception message.

Additional context / logs / screenshots / links to code The problem which I found (but might be also elsewhere) is in the ConfigurationManager class, e.g. https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/dev/src/Microsoft.IdentityModel.Protocols/Configuration/ConfigurationManager.cs#L201

jennyf19 commented 2 months ago

@iNinja FYI