Comments (9)
I am sorry for the delay, without any changes to the code I saw that the code works fast.
from cognito-srp.
Hey, what go version and OS are you on? and does it come back successful after those 3 minutes?
I haven't seen this myself but it sounds most likely to be a network issue. You could try again on your home/work networks to see if it behaves differently. The example is also without any error handling so it might be worth adding some panics just to see if you're hitting an error before the request is sent.
from cognito-srp.
@alexrudd the request succeeded at the end. I am using MacOS
from cognito-srp.
Try enabling debug logging when building the aws.Config object: cfg.LogLevel = aws.LogDebug
This will give you log lines such as:
2018/07/19 10:28:11 DEBUG: Request cognito-idp/InitiateAuth Details:
...
2018/07/19 10:28:11 DEBUG: Response cognito-idp/InitiateAuth Details:
You should be able to determine which calls are taking up so much time. If the delay is happening between the Request/Response log lines then it's likely a network problem, otherwise it must be something in the library code.
from cognito-srp.
I did what you suggested the inititateAuth response takes a lot of time. What in the network could be a problem here I really don't understand.
Same piece of code I was able to execute and the response came back almost immediately. This was on Windows 10 OS
2018/07/28 10:52:06 DEBUG: Request cognito-idp/InitiateAuth Details:
---[ REQUEST POST-SIGN ]-----------------------------
POST / HTTP/1.1
Host: cognito-idp.us-west-2.amazonaws.com
User-Agent: aws-sdk-go/2.0.0-preview.4 (go1.10.3; darwin; amd64)
Content-Length: 889
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth
Accept-Encoding: gzip
-----------------------------------------------------
2018/07/28 10:55:53 DEBUG: Response cognito-idp/InitiateAuth Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 2665
Content-Type: application/x-amz-json-1.1
Date: Sat, 28 Jul 2018 05:25:53 GMT
X-Amzn-Requestid: <REQUESTID>
-----------------------------------------------------
from cognito-srp.
Weird, I've only been using this on Win10 and WSL Ubuntu. I'll try this on my Mac when I get a chance and see if I have the same problem.
What happens if you just curl
that domain, does it still take as long to return a response?
Here's what I get:
$ time curl https://cognito-idp.us-west-2.amazonaws.com
{"code":"BadRequest","message":"The server did not understand the operation that was requested.","type":"client"}
real 0m0.906s
user 0m0.031s
sys 0m0.016s
You could also time the DNS request to see if it's the domain resolution which is taking so long:
$ time dig +noall +answer cognito-idp.us-west-2.amazonaws.com
cognito-idp.us-west-2.amazonaws.com. 26 IN A 54.71.113.74
cognito-idp.us-west-2.amazonaws.com. 26 IN A 54.148.226.134
cognito-idp.us-west-2.amazonaws.com. 26 IN A 54.187.46.195
real 0m0.023s
user 0m0.000s
sys 0m0.031s
from cognito-srp.
Hey, I finally got some time to test this on my Mac, but I'm still not seeing the same problem that you are.
InitiateAuth came back straight away:
2018/08/17 23:38:22 DEBUG: Request cognito-idp/InitiateAuth Details:
---[ REQUEST POST-SIGN ]-----------------------------
POST / HTTP/1.1
Host: cognito-idp.eu-west-1.amazonaws.com
User-Agent: aws-sdk-go/2.0.0-preview.3 (go1.10.1; darwin; amd64)
Content-Length: 945
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth
Accept-Encoding: gzip
-----------------------------------------------------
2018/08/17 23:38:22 DEBUG: Response cognito-idp/InitiateAuth Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Length: 2667
Content-Type: application/x-amz-json-1.1
Date: Fri, 17 Aug 2018 22:38:22 GMT
X-Amzn-Requestid: 3f252071-a26e-11e8-9ca9-5bc524bcc2c5
I am using a different region to you, but that shouldn't make a difference.
I'm pretty sure this is a local network issue you're experiencing. Please follow-up on my suggestion to test DNS response times.
from cognito-srp.
Sure @alexrudd I will do what you suggested and report back
from cognito-srp.
Going to close this for now
from cognito-srp.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cognito-srp.