Comments (2)
Just sorting out my own auth/API issues looking through these posts, but I have a guess - maybe your non-dev account doesn't own the game on Epic Store, therefore doesn't have the access to it and is an Invalid User?
from eos_plugin_for_unity.
The problem was me not understanding the authentication flow. I got it working:
public void RequestPlatformID(Action<GetPlatformIDResult, string> callback) {
LoginToEpic(LoginCredentialType.PersistentAuth, callback);
}
private void LoginToEpic(LoginCredentialType loginType, Action<GetPlatformIDResult, string> callback) {
Credentials credentials = new Credentials {
Type = loginType,
};
EOSManager.Instance.StartLoginWithLoginOptions(new LoginOptions {
Credentials = credentials,
ScopeFlags = AuthScopeFlags.BasicProfile | AuthScopeFlags.FriendsList | AuthScopeFlags.Presence,
}, (loginCallback => {
if (loginCallback.ResultCode == Result.Success) {
callback?.Invoke(GetPlatformIDResult.Success, loginCallback.LocalUserId.ToString());
Token tolkien = EOSManager.Instance.GetUserAuthTokenForAccountId(loginCallback.LocalUserId);
Epic.OnlineServices.Connect.LoginOptions options = new Epic.OnlineServices.Connect.LoginOptions {
Credentials = new Epic.OnlineServices.Connect.Credentials {
Token = tolkien.AccessToken,
Type = ExternalCredentialType.Epic,
},
};
EOSManager.Instance.StartConnectLoginWithOptions(options, (connectLoginCallback) => {
if (connectLoginCallback.ResultCode == Result.Success) {
callback?.Invoke(GetPlatformIDResult.Success, loginCallback.LocalUserId.ToString());
} else if (connectLoginCallback.ResultCode == Result.InvalidUser) {
EOSManager.Instance.CreateConnectUserWithContinuanceToken(connectLoginCallback.ContinuanceToken, (onCreateConnectUserCallback) => {
if (onCreateConnectUserCallback.ResultCode == Result.Success) {
callback?.Invoke(GetPlatformIDResult.Success, loginCallback.LocalUserId.ToString());
} else {
Debug.LogErrorFormat(DEBUG + "CreateConnectUserWithContinuanceToken ResultCode ({0})", onCreateConnectUserCallback.ResultCode);
callback?.Invoke(GetPlatformIDResult.Failed, string.Empty);
}
});
} else {
Debug.LogErrorFormat(DEBUG + "StartConnectLoginWithEpicAccount ResultCode ({0})", connectLoginCallback.ResultCode);
callback?.Invoke(GetPlatformIDResult.Failed, string.Empty);
}
});
} else if (loginType == LoginCredentialType.PersistentAuth) {
LoginToEpic(LoginCredentialType.AccountPortal, callback);
} else {
Debug.LogErrorFormat(DEBUG + "StartLoginWithLoginOptions ResultCode ({0})", loginCallback.ResultCode);
callback?.Invoke(GetPlatformIDResult.Failed, string.Empty);
}
}));
}
from eos_plugin_for_unity.
Related Issues (20)
- Netcode for GameObjects - Kicking a client as a host also kicks the host. (only with EOSTransport) HOT 6
- Using EOS Voice as an Audio Source (LocalRTCOptions) on Create/Join Lobbies HOT 4
- Manual Achievements not working for me - First time using Epic games plugin for Unity HOT 5
- Interrupting joining process causes the host to crash. HOT 8
- Having issues with member inconsistency and lobby backend attributes missing from client. HOT 2
- Member count not updating on host HOT 5
- Win32 Exception HOT 3
- Editor hangs when playing more than one time HOT 5
- NULL EOS Platform returned by native code: issue probably occurred in GFX Plugin! HOT 6
- Error from adding package via Git URL HOT 2
- Reauthorization via steam session ticket HOT 4
- First launch per steam account fails to connect to EOS service (always). HOT 4
- Keychain access request on Mac HOT 4
- Error after importing EOS tarball in Unity on MAC. HOT 2
- UnreliableUnordered reliability is resending packets when more than one client is connected to you HOT 4
- "eac_launcher" app not opening HOT 7
- How do I invite players to EOS lobby set as InviteOnly via Steam invite? HOT 2
- Issue with easy anti cheat exe bypass HOT 3
- Samples, steam account linking, loginCallbackInfo.LocalUserId is null HOT 3
- Possible typos in SteamManager edge case? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eos_plugin_for_unity.