in Assets/Scripts/GameAuth.cs [102:130]
public async Task<string> SignInAsync(string userName, string password)
{
try
{
var provider = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(), RegionEndpoint.APNortheast2);
//Pool ID, Client App ID, Provider, ClientSecret
CognitoUserPool userPool =
new CognitoUserPool(GamePlayManager.Singleton.USERPOOL_ID,
GamePlayManager.Singleton.CLIENT_ID,
provider
);
CognitoUser user = new CognitoUser(userName, GamePlayManager.Singleton.CLIENT_ID, userPool, provider); //Client ID does not mean App Client ID in User Pool
AuthFlowResponse authResponse = await user.StartWithSrpAuthAsync(new InitiateSrpAuthRequest()
{
Password = password
}).ConfigureAwait(false);
//CognitoAWSCredentials credentials =
// user.GetCognitoAWSCredentials(GamePlayManager.Singleton.IDENTITYPOOL_ID, RegionEndpoint.APNortheast2); //identityPoolID
string jwt = authResponse.AuthenticationResult.AccessToken;
return jwt;
}
catch (System.Exception e)
{
Debug.Log(e);
return "";
}
}