Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CurrentUser does not match the current Logon payload 'requriesTwoFactorAuth' #1

Open
jlong23 opened this issue Nov 3, 2023 · 1 comment

Comments

@jlong23
Copy link

jlong23 commented Nov 3, 2023

Version 1.15.0

java.lang.IllegalArgumentException: The field requiresTwoFactorAuth in the JSON string is not defined in the CurrentUser properties. JSON: {"requiresTwoFactorAuth":["emailOtp"]}
at io.github.vrchatapi.model.CurrentUser.validateJsonObject(CurrentUser.java:1810) ~[vrchatapi-java-1.15.0.jar:na]
at io.github.vrchatapi.model.CurrentUser$CustomTypeAdapterFactory$1.read(CurrentUser.java:1970) ~[vrchatapi-java-1.15.0.jar:na]
at io.github.vrchatapi.model.CurrentUser$CustomTypeAdapterFactory$1.read(CurrentUser.java:1960) ~[vrchatapi-java-1.15.0.jar:na]
at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:204) ~[gson-2.10.1.jar:na]
at com.google.gson.Gson.fromJson(Gson.java:1227) ~[gson-2.10.1.jar:na]
at com.google.gson.Gson.fromJson(Gson.java:1137) ~[gson-2.10.1.jar:na]
at com.google.gson.Gson.fromJson(Gson.java:1047) ~[gson-2.10.1.jar:na]
at com.google.gson.Gson.fromJson(Gson.java:1014) ~[gson-2.10.1.jar:na]
at io.github.vrchatapi.JSON.deserialize(JSON.java:244) ~[vrchatapi-java-1.15.0.jar:na]
at io.github.vrchatapi.ApiClient.deserialize(ApiClient.java:851) ~[vrchatapi-java-1.15.0.jar:na]
at io.github.vrchatapi.ApiClient.handleResponse(ApiClient.java:1061) ~[vrchatapi-java-1.15.0.jar:na]
at io.github.vrchatapi.ApiClient.execute(ApiClient.java:985) ~[vrchatapi-java-1.15.0.jar:na]
at io.github.vrchatapi.api.AuthenticationApi.getCurrentUserWithHttpInfo(AuthenticationApi.java:453) ~[vrchatapi-java-1.15.0.jar:na]
at io.github.vrchatapi.api.AuthenticationApi.getCurrentUser(AuthenticationApi.java:434) ~[vrchatapi-java-1.15.0.jar:na]
at org.tfs.vrchat.api.client.VRChatAPIClient.login(VRChatAPIClient.java:56) ~[classes/:na]

Suspect that it needs a secondary call too for final Token Generation.

@ariesclark
Copy link
Member

We're aware of this issue, but it's difficult to solve since many of our generators don't support the pattern that VRChat returns for this, needing to use oneOf in JSON Schema. You'll need to catch the error and handle it manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants