Browse Source

Replaced PSN auth request with a GetIdTokenRequest with the appropriate parameters. Still not quite working, some things aren't set up quite correctly yet in the backend.

master
Nico de Poel 4 years ago
parent
commit
560e27532c
  1. 18
      Assets/Scripts/EpicVoiceChatTest.cs

18
Assets/Scripts/EpicVoiceChatTest.cs

@ -56,7 +56,7 @@ public class EpicVoiceChatTest : MonoBehaviour
private EOSVoiceChat voiceChat;
private string xstsToken;
private string psnToken;
private string psnIdToken;
private string XAudio29DllPath =>
#if UNITY_EDITOR
@ -260,15 +260,17 @@ public class EpicVoiceChatTest : MonoBehaviour
#elif UNITY_PS4 || UNITY_PS5
var loggedInUser = PSInput.RefreshUsersDetails(0);
// TODO: this needs to be a GetIdTokenRequest with client ID, client secret and "openid id_token:basic_claims" as the scope
var request = new Authentication.GetAuthorizationCodeRequest
// Note: this requires a Presence2 service to be enabled on the game app and activated on the corresponding auth server.
// This auth server's client ID needs to be registered as an Identity Provider on the EOS portal.
var request = new Authentication.GetIdTokenRequest
{
UserId = loggedInUser.userId,
ClientId = "83c6530f-741e-45ff-af3a-ddb90628a928",
Scope = "psn:s2s",
ClientSecret = "zvgUjFZ5edoiCYNV",
Scope = "openid id_token:basic_claims",
};
var requestOp = new AsyncRequest<Authentication.GetAuthorizationCodeRequest>(request)
var requestOp = new AsyncRequest<Authentication.GetIdTokenRequest>(request)
.ContinueWith(antecedent =>
{
if (antecedent?.Request == null || antecedent.Request.Result.apiResult != APIResultTypes.Success)
@ -279,19 +281,19 @@ public class EpicVoiceChatTest : MonoBehaviour
}
status.AppendLine("PSN authenticated");
psnToken = antecedent.Request.AuthCode;
psnIdToken = antecedent.Request.IdToken;
});
Authentication.Schedule(requestOp);
yield return new WaitUntil(() => !string.IsNullOrEmpty(psnToken));
yield return new WaitUntil(() => !string.IsNullOrEmpty(psnIdToken));
connectInterface.Login(new Epic.OnlineServices.Connect.LoginOptions
{
Credentials = new Epic.OnlineServices.Connect.Credentials
{
Type = ExternalCredentialType.PsnIdToken,
Token = psnToken,
Token = psnIdToken,
},
}, null, HandleConnectResult);
#else

Loading…
Cancel
Save