title: How to use the code returned from Cognito to get AWS credentials?
body: <p>Right now, I'm struggling to understand AWS Cognito so maybe someone could help me out. I set a domain to serve Cognito's hosted UI for my User Pool like what's described <a href="http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-ux.html" rel="noreferrer">here</a>. So when I go to <code>https://&lt;my-domain&gt;.auth.us-east-1.amazoncognito.com/login?response_type=code&amp;client_id=&lt;MY_POOL_CLIENT_ID&gt;&amp;redirect_uri=https://localhost:8080</code> I get a login page where my users can login to my app with Google. That part is working great.</p>
  <p>I'm confused about what to do with the code that is returned from that page once my user logs in. So once I get redirected to Google and authorize the application to view my information, I get redirected back to one of my URLs with a code in the query params. Right now I'm redirecting to localhost, so the redirect URL look like this:</p>
  <p><code>https://localhost:8080/?code=XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX</code></p>
  <p>What exactly is this code? Also, how do I use it to get access to AWS resources for my user?</p>