Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by tbukoski · Jul 27, 2018 at 02:41 PM · authenticationamazonnet

AWSSDK Cognito User Pool Authentication issue with StartWithSrpAuthAsync() in Unity 2018.2.0

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 code for the authentication flow 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/

Here is my code attached to a button in my unity scene:

 using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
 using Amazon;
 using Amazon.Runtime;
 using Amazon.CognitoIdentityProvider;
 using Amazon.Extensions.CognitoAuthentication;
 
 
 public class test : MonoBehaviour {
 
 public string userName;
 public string userPassword;
 public string clientID;
 public string poolID;
 
 
 public AuthFlowResponse authResponse;
 public CognitoUserPool userPool;
 public AmazonCognitoIdentityProviderClient provider;
 public CognitoUser user;
 
 void Start()
 {
 
 }
 public void OnClick()
 {
     try
     {
         AuthenticateWithSrpAsync();
     }
     catch(Exception ex)
     {
         Debug.Log(ex);
     }
 
 }
 
 public async void AuthenticateWithSrpAsync()
 {
     RegionEndpoint CognitoIdentityRegion = RegionEndpoint.USEast1;
     provider = new AmazonCognitoIdentityProviderClient(null, CognitoIdentityRegion);
     userPool = new CognitoUserPool(poolID, clientID, provider, null);
     user = new CognitoUser(userName, clientID, userPool, provider);
     string name = user.Username.ToString();
     Debug.Log(name);                  // this line is performed but nothing afterwards is

     authResponse = await user.StartWithSrpAuthAsync(new InitiateSrpAuthRequest() {
 
         Password = userPassword
 
     }).ConfigureAwait(false);
     Debug.Log(user.SessionTokens.IdToken);
     Debug.Log("Success");
 }
 
 }

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.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image nadunliyanage · Mar 07 at 05:07 AM 0
Share

Were you able to get this fixed? I am in a similar situation. When trying to do this ( provider = new AmazonCognitoIdentityProviderClient(null, CognitoIdentityRegion);) I get an exception as "Value cannot be null. Parameter name: stream"

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

87 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

All scripts fail? 1 Answer

https -- works in IDE & Standalone, does not work in web browser 1 Answer

Best way to handle server side inventory management? 0 Answers

Bringing a session variable to another page using php 1 Answer

How to upload/PUT to a GitHub repository while playing 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges