Hello, recently I’ve managed to implement EOS with some plugin from the marketplace and I want to also be able to authenticate the user on my api.
Structure
User enters the game → The plugin manages to successfully log him in → I copy the authentication token and send it to my API in order to keep some tracking about the user (stats, save games, profile picture, etc), in order to know if the token is valid or not and ensure I select the right user from my database, I need to validate this things with EOS, and this is the point that made my life a nightmare for the past 4 days
Right now, I’ve managed to initialize the SDK in .NET Core 8, I’ve also got the authentication interface, but when call the login method, nothing seems to happen, no errors, no nothing, the callback is never happening, I’ve tried to also add A Completion task in order to wait for the callback, I’ve waited for like 5 minutes, and nothing happen
One more thing I’ve also checked multiple times the eos keys, they are fine, judging that they already work with an external plugin.
here is how the login part looks like:
var loginOpsNew = new Epic.OnlineServices.Auth.LoginOptions { Credentials = new Epic.OnlineServices.Auth.Credentials() { Type = LoginCredentialType.RefreshToken, Id = null, Token = token } };
var response = new object();
//authInterface.Login(ref loginOpsNew, response, LoginCompletionDelegate);
// Create a TaskCompletionSource that you will complete in the callback
var tcs = new TaskCompletionSource<LoginResult>();
// Login and pass a lambda to handle the callback
authInterface.Login(ref loginOpsNew, response, (ref Epic.OnlineServices.Auth.LoginCallbackInfo data) =>
{
if (data.ResultCode == Result.Success)
{
// On success, set the result of the TaskCompletionSource
tcs.SetResult(new LoginResult
{
Success = true,
AccountId = data.LocalUserId.ToString()
});
}
else
{
// On failure, set the result of the TaskCompletionSource
tcs.SetResult(new LoginResult
{
Success = false,
ErrorCode = data.ResultCode
});
}
});
// Await the TaskCompletionSource's task
var loginResult = await tcs.Task;