Skip to content

Error reading user role assignments #827

@MichaelGrafnetter

Description

@MichaelGrafnetter

Describe the bug?

I receive the System.IO.InvalidDataException when trying to read user role assignments:

{
"id":"ra1wz3i4y0GYdw2va697",
"label":"Super Administrator",
"type":"SUPER_ADMIN",
"status":"ACTIVE",
"created":"2025-10-31T14:42:35Z",
"lastUpdated":"2025-10-31T14:42:35Z",
"assignmentType":"USER",
"_links":{
   "assignee":{"href":"https://trial-1771280.okta.com/api/v1/users/00uwz37wlz4XWgEZB697"}
  }
}

incorrectly matches more than one schema (should be exactly one match)

What is expected to happen?

The JSON should be parsed properly.

What is the actual behavior?

There is probably a missing discriminator between StandardRole and CustomRole, which was introduced in v10, switching from role in v9.

Reproduction Steps?

RoleAssignmentAUserApi roleAssignmentApi = new(_oktaConfig);

await foreach (var roleAssignment in roleAssignmentApi.ListAssignedRolesForUser("00uwz37wlz4XWgEZB697"))
{
}

Additional Information?

No response

.NET Version

10.0.101

SDK Version

10.0.1

OS version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions