In Unity, I understand how the CognitoAWSCredentials works with Facebook, Twitter, or any other largely supported service. In extending CognitoAWSCredentials for developer identities, however, I'm facing a few problems - namely, that calling RefreshIdentity() has a problem with "Network in game thread", and the async callbacks seem to be also having issues.
Do you have any examples for extending CognitoAWSCredentials for developer authenticated identities? Here's what I've been using so far. Thanks!
public class CustomCognitoCredentials : Amazon.CognitoIdentity.CognitoAWSCredentials
{
private string Email { get; set; }
private string Password { get; set; }
private string DeviceId { get; set; }
private static object refreshIdLock = new object();
public CustomCognitoCredentials() : base(
Defines.Global.AccountId,
Defines.Global.CognitoIdentityPoolId,
Defines.Global.CognitoUnauthRoleArn, Defines.Global.CognitoAuthRoleArn,
new Amazon.CognitoIdentity.AmazonCognitoIdentityClient(new Amazon.Runtime.AnonymousAWSCredentials(), Defines.Global.CognitoIdentityRegion),
new Amazon.SecurityToken.AmazonSecurityTokenServiceClient(new Amazon.Runtime.AnonymousAWSCredentials(), Defines.Global.CognitoIdentityRegion))
{
DeviceId = UnityEngine.SystemInfo.deviceUniqueIdentifier;
}
public void SetEmailAndPassword(string Email, string Password)
{
this.Email = Email;
this.Password = Password;
}
public new IdentityState RefreshIdentity()
{
SimpleJSON.JSONNode ParsedBody = GetIdAndToken();
return new IdentityState(ParsedBody["IdentityId"], Defines.Global.CognitoDeveloperProvider, ParsedBody["OpenIdToken"], false);
}
}
Hey,
In Unity, I understand how the CognitoAWSCredentials works with Facebook, Twitter, or any other largely supported service. In extending CognitoAWSCredentials for developer identities, however, I'm facing a few problems - namely, that calling RefreshIdentity() has a problem with "Network in game thread", and the async callbacks seem to be also having issues.
Do you have any examples for extending CognitoAWSCredentials for developer authenticated identities? Here's what I've been using so far. Thanks!