Search Unity

AWSSDK CognitoAuthentication Extension Library issue with StartWithSrpAuthAsync() in Unity 2018.2.0

Discussion in 'Windows' started by tbukoski, Jul 26, 2018.

  1. tbukoski

    tbukoski

    Joined:
    Jul 10, 2018
    Posts:
    1
    I am attempting to follow the "authenticate with SRP" flow for AWS Cognito user pool authorization for .NET in my Unity 2018.2.0 project. The following code was provided by Amazon with their Cognito Authentication Extension Library for .NET post located at: https://aws.amazon.com/blogs/developer/cognitoauthentication-extension-library-developer-preview/

    Code (CSharp):
    1. using Amazon.Runtime;
    2. using Amazon.CognitoIdentityProvider;
    3. using Amazon.Extensions.CognitoAuthentication;
    4.  
    5. public async void AuthenticateWithSrpAsync()
    6. {
    7.     var provider = new AmazonCognitoIdentityProviderClient(new AnonymousAWSCredentials(),
    8.                                                            FallbackRegionFactory.GetRegionEndpoint());
    9.     CognitoUserPool userPool = new CognitoUserPool("poolID", "clientID", provider);
    10.     CognitoUser user = new CognitoUser("username", "clientID", userPool, provider);
    11.  
    12.     string password = "userPassword";
    13.  
    14.     AuthFlowResponse context = await user.StartWithSrpAuthAsync(new InitiateSrpAuthRequest()
    15.     {
    16.         Password = password
    17.     }).ConfigureAwait(false);
    18. }
    I have all the AWS .dll resources in my assets (AWSSDK.Core, AWSSDK.SecurityToken, AWSSDK.CognitoIdentityProvider, and SAWSSDK.Extension.CognitoAuthentication) and get no errors in VS2017 or Unity. The code runs fine up to the call for await StartWithSrpAuthAsync(). Calling this function however results in no exceptions, results, or errors and never makes it to the next line.

    I cannot find any other posts replicating this issue, but found several where this seemed to work fine. Any help would be much appreciated.
     
  2. senis_kenis

    senis_kenis

    Joined:
    Dec 1, 2012
    Posts:
    4
  3. achang

    achang

    Joined:
    May 23, 2014
    Posts:
    2
    Does anyone have a solution for this? I have the same problem where StartWithSrpAuthSync() goes nowhere.