vrchatapi / vrchatapi-csharp

🟣VRChat API Library for C#
https://www.nuget.org/packages/VRChat.API
MIT License
54 stars 12 forks source link

Cannot Login with AddApiKey #19

Closed Sayamame-beans closed 2 months ago

Sayamame-beans commented 7 months ago

Like sample code in this project, I execute

~
Configuration config = new Configuration();
config.Username = username;
config.Password = password;
config.UserAgent = "ExampleProgram/0.0.1";

config.AddApiKey("auth", authKey);

ApiClient client = new ApiClient();

AuthenticationApi authApi = new AuthenticationApi(client, client, config);

AvatarsApi avatarsApi = new AvatarsApi(client, client, config);
try
{
    ApiResponse<CurrentUser> currentUserResp = authApi.GetCurrentUserWithHttpInfo();
~

then, I get

ArgumentException: The parameter '{0}' cannot be an empty string.
Parameter name: cookie.Domain
System.Net.CookieContainer.Add (System.Net.Cookie cookie) (at <ae467d6c56404add82dd0ad831025110>:0)
VRChat.API.Client.ApiClient.Exec[T] (RestSharp.RestRequest req, VRChat.API.Client.RequestOptions options, VRChat.API.Client.IReadableConfiguration configuration) (at <dc7da9a4c19944efbe0898a394ec754d>:0)
VRChat.API.Client.ApiClient.Get[T] (System.String path, VRChat.API.Client.RequestOptions options, VRChat.API.Client.IReadableConfiguration configuration) (at <dc7da9a4c19944efbe0898a394ec754d>:0)
VRChat.API.Api.AuthenticationApi.GetCurrentUserWithHttpInfo (System.Int32 operationIndex) (at <dc7da9a4c19944efbe0898a394ec754d>:0)

Environment: Windows 10 Pro 22H2 Unity 2022.3.6f1

Sayamame-beans commented 2 months ago

Is this fixed in #20 ?

jellejurre commented 2 months ago

yes. if you build the sdk from source now it should work