Skip to content

Switch From Using Unmaintained Newtonsoft.Json to Using System.Text.Json in Powershell Authentication Module #2774

Open
@fey101

Description

@fey101

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

It should be easier to replace JsonConvert.SerializeObject with JsonSerializer.Seralize in other files like

var body = JsonConvert.SerializeObject(content);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttype:securitySecurity, or privacy issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions