Data Type Mismatch for `SkipLogoutConsent` Property
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
There appears to be a data type mismatch between the SkipLogoutConsent property in the .NET SDK and its definition in the Ory Hydra API. This issue causes deserialization failures when handling responses from the endpoint, leading to request failures.
In the latest update of the .NET SDK, the SkipLogoutConsent property is defined as a bool type. However, in the Ory Hydra source code, this property is nullable, meaning it can return null from the API endpoint. This discrepancy results in deserialization errors when the API response contains null for the skip_logout_consent field.
Affected Code
- .NET SDK Definition :
TheSkipLogoutConsentproperty is defined as a bool in the .NET SDK:
Link to .NET SDK Code - Ory Hydra Definition :
In the Ory Hydra Go client, theSkipLogoutConsentproperty is nullable:
Link to Ory Hydra Code - Deserialization Failure :
The deserialization error occurs in the .NET SDK when processing the API response:
Link to Deserialization Code
Root Cause
The root cause of the issue is that the SkipLogoutConsent property in the .NET SDK is defined as a non-nullable bool, while the Ory Hydra API allows it to return null. When the API response includes null for this field, the deserialization process fails because null cannot be directly assigned to a bool.
Impact
This issue prevents successful deserialization of the API response, causing requests to fail whenever the skip_logout_consent field is null.
Proposed Solution
To resolve this issue, the SkipLogoutConsent property in the .NET SDK should be updated to accommodate nullable values or Ory Hydra API should always return a bool value.
Reproducing the bug
- Make a request to an Ory Hydra endpoint that includes the
skip_logout_consentfield. - Ensure the response contains
nullfor theskip_logout_consent field. - Observe the deserialization failure in the .NET SDK.
Relevant log output
Relevant configuration
Version
2.2.1
On which operating system are you observing this issue?
Windows
In which environment are you deploying?
Binary
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Ory.Hydra.Client/Model/HydraOAuth2Client.cs at the SkipLogoutConsent property, then inspect deserialization in src/Ory.Hydra.Client/Client/ApiClient.cs. Compare the SDK definition with the linked Ory Hydra client definition and reproduce a response containing a null skip_logout_consent value. Done means the SDK can deserialize that response without failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100