@ -56,7 +56,7 @@ public class EpicVoiceChatTest : MonoBehaviour
private EOSVoiceChat voiceChat ;
private EOSVoiceChat voiceChat ;
private string xstsToken ;
private string xstsToken ;
private string psnToken ;
private string psnId Token ;
private string XAudio29DllPath = >
private string XAudio29DllPath = >
#if UNITY_EDITOR
#if UNITY_EDITOR
@ -260,15 +260,17 @@ public class EpicVoiceChatTest : MonoBehaviour
#elif UNITY_PS4 || UNITY_PS5
#elif UNITY_PS4 || UNITY_PS5
var loggedInUser = PSInput . RefreshUsersDetails ( 0 ) ;
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 ,
UserId = loggedInUser . userId ,
ClientId = "83c6530f-741e-45ff-af3a-ddb90628a928" ,
ClientId = "83c6530f-741e-45ff-af3a-ddb90628a928" ,
Scope = "psn:s2s" ,
ClientSecret = "zvgUjFZ5edoiCYNV" ,
Scope = "openid id_token:basic_claims" ,
} ;
} ;
var requestOp = new AsyncRequest < Authentication . GetAuthorizationCode Request > ( request )
var requestOp = new AsyncRequest < Authentication . GetIdToken Request > ( request )
. ContinueWith ( antecedent = >
. ContinueWith ( antecedent = >
{
{
if ( antecedent ? . Request = = null | | antecedent . Request . Result . apiResult ! = APIResultTypes . Success )
if ( antecedent ? . Request = = null | | antecedent . Request . Result . apiResult ! = APIResultTypes . Success )
@ -279,19 +281,19 @@ public class EpicVoiceChatTest : MonoBehaviour
}
}
status . AppendLine ( "PSN authenticated" ) ;
status . AppendLine ( "PSN authenticated" ) ;
psnToken = antecedent . Request . AuthCode ;
psnId Token = antecedent . Request . IdToken ;
} ) ;
} ) ;
Authentication . Schedule ( requestOp ) ;
Authentication . Schedule ( requestOp ) ;
yield return new WaitUntil ( ( ) = > ! string . IsNullOrEmpty ( psnToken ) ) ;
yield return new WaitUntil ( ( ) = > ! string . IsNullOrEmpty ( psnId Token ) ) ;
connectInterface . Login ( new Epic . OnlineServices . Connect . LoginOptions
connectInterface . Login ( new Epic . OnlineServices . Connect . LoginOptions
{
{
Credentials = new Epic . OnlineServices . Connect . Credentials
Credentials = new Epic . OnlineServices . Connect . Credentials
{
{
Type = ExternalCredentialType . PsnIdToken ,
Type = ExternalCredentialType . PsnIdToken ,
Token = psnToken ,
Token = psnId Token ,
} ,
} ,
} , null , HandleConnectResult ) ;
} , null , HandleConnectResult ) ;
#else
#else