okta / okta-sdk-dotnet

A .NET SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
Other
160 stars 100 forks source link

GetApplicationUserWithHttpInfoAsync returns null with ErrorText #599

Closed koswedo closed 2 years ago

koswedo commented 2 years ago

Describe the bug?

A new user is created and assigned to an application using the new version of the Okta.Sdk (v6.0.0). When I tried to retrieve the application user using GetApplicationUserWithHttpInfoAsync, it returns null with ErrorText:

Error converting value {null} to type 'System.DateTimeOffset'. Path 'passwordChanged', line 1, position 223.

The user is valid and accessible. This same user created with v6.0.0 causes no issue when I use the previous version of the Okta.Sdk (v5.6.2) to retrieve the same information.

What is expected to happen?

I expected to get the AppUser whether the passwordChanged is null or not. Maybe, this field (and maybe others) should be nullable?

What is the actual behavior?

When I tried to retrieve the application user using GetApplicationUserWithHttpInfoAsync, it returns null with ErrorText:

Error converting value {null} to type 'System.DateTimeOffset'. Path 'passwordChanged', line 1, position 223.

Reproduction Steps?

A new user is created and assigned to an application using the new version of the Okta.Sdk (v6.0.0). When I tried to retrieve the application user using GetApplicationUserWithHttpInfoAsync, it returns null with ErrorText:

Error converting value {null} to type 'System.DateTimeOffset'. Path 'passwordChanged', line 1, position 223.

Additional Information?

No response

.NET Version

6.0.402

SDK Version

6.0.0

OS version

BuildNumber Caption OSArchitecture Version 19042 Microsoft Windows 10 Enterprise 64-bit 10.0.19042

laura-rodriguez commented 2 years ago

Hi @koswedo,

Thank you for reporting this! I'll file an internal ticket to be prioritized accordingly.

internal Ref: OKTA-548422

laura-rodriguez commented 2 years ago

Hi @koswedo,

Can you please provide more details on what settings you use when creating a new user? Apparently, the user you have doesn't have credentials. Is this assumption correct?

We do have a test that is verifying this particular scenario and it's green, so I'll need more info from your side to try to reproduce the issue.

Thank you!

koswedo commented 2 years ago

Hi @laura-rodriguez, I don't have a source code that I can show right now. I will prepare something as soon as I can. What I can tell you is that I can use the user to login successfully.

Thanks for taking care of this.

laura-rodriguez commented 2 years ago

No worries @koswedo! I was actually able to reproduce this by creating users without credentials. I do have a PR ready for review: https://github.com/okta/okta-sdk-dotnet/pull/603