Description
Describe the bug
The Newtonsoft.Json dependency of the SDK's authentication module, is no longer actively maintained. In the past we have also encountered trust issues with the signed Newtonsoft.Json package throwing verificationError 18 which interprets to
"Your file is signed but we don't trust it"
and PS SDK users, have raised this too as an issue for them. See #2741 and JamesNK/Newtonsoft.Json#2755
Expected behavior
Avoid Newtonsoft.Json related issues mentioned above by switching to System.Text.Json
How to reproduce
The task will include writing tests to cover the affected code segments and mitigate against any regressions before switching to system.text.json.
The current tricky work is the Json DOM handling in the 3 files below
- https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Authentication/Authentication/Common/GraphSettings.cs
- https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Authentication/Authentication/Common/GraphSettingsConverter.cs
- https://github.com/microsoftgraph/msgraph-sdk-powershell/blob/dev/src/Authentication/Authentication/Helpers/StringUtil.cs
It should be easier to replace JsonConvert.SerializeObject with JsonSerializer.Seralize in other files like
Acceptance Criteria
- 100% test coverage on affected files/files originally using Newtonsoft.Json package
- Working authentication module with the tests passing and using System.Text.Json instead of Newtonsoft.Json