Guest User

Untitled

a guest
Dec 13th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. var client = AmazonClient(sessionConfig, requestconfig);
  2.  
  3. client.GetClientTokens();
  4.  
  5. var cred = new CognitoAWSCredentials(_sessionConfig.IdentityPoolId,` RegionEndpoint.EUCentral1);
  6.  
  7. var provider = new AmazonCognitoIdentityProviderClient(cred, RegionEndpoint.EUCentral1);
  8.  
  9. CognitoUserPool userPool = new CognitoUserPool(_sessionConfig.UserPoolId, _sessionConfig.ClientId, provider);
  10.  
  11. CognitoUser user = new CognitoUser(_sessionConfig.UserPoolId, _sessionConfig.ClientId, userPool, provider, _sessionConfig.Secret, _sessionConfig.UserName);
  12.  
  13. var authRequest = new InitiateSrpAuthRequest()
  14. {
  15.  
  16. Password = _sessionConfig.Password
  17.  
  18. };
  19.  
  20. AuthFlowResponse authResponse = await user.StartWithSrpAuthAsync(authRequest).ConfigureAwait(false);
  21.  
  22. client.GetApiResource(absolutpath);
  23.  
  24. _requestConfig.AbsolutePath = absolutePath;
  25. //Signmethod from Amazon
  26. GetSignedRequest();
  27.  
  28. var responses = _webRequest.GetResponse();
  29. var result = responses.GetResponseStream();
  30. var data = string.Empty;
  31.  
  32. using (var sr = new StreamReader(result))
  33. {
  34. data = sr.ReadToEnd();
  35. }
  36.  
  37. return data;
  38.  
  39. user.StartWithSrpAuthAsync(authRequest).ConfigureAwait(false);
Add Comment
Please, Sign In to add comment