title: What is the REST (or CLI) API for logging in to Amazon Cognito user pools
body: <p><strong><em>How do i make logins happen via Amazon Cognito REST APIs (for user pools) on platforms for which there is no official SDK?</em></strong> - Note that i am asking for user pools - not identity pools. </p>
  
  <hr>
  
  <h1>Synopsis</h1>
  
  <hr>
  
  <p>Amazon cognito provides 3 kinds of logins:</p>
  
  <ul>
  <li>federated logins (creates <strong><em>identity pools</em></strong>)  - using social connects like FB, Twitter, G+ etc</li>
  <li>AWS managed logins (creates <strong><em>user pools</em></strong>) - using Amazon's own managed signup, signin, forgot password, reset password services</li>
  <li>developer provided logins (my custom designed authentication service managed by myself)</li>
  </ul>
  
  <p><strong><em>I am using the second one (with User Pools)</em></strong></p>
  
  <hr>
  
  <p>Amazon cognito has several SDKs for android, iOS, javascript, Xamarin etc. Cognito also provides REST APIs for building on platforms other than those supported by official SDKs. <strong><em>I am building an app for a different platform</em></strong> and, hence, REST API is my only way as there is no official SDK for my platform. </p>
  
  <p>The Cognito REST API provides various endpoints for '<em>sign up</em>', '<em>forgot password</em>', '<em>confirm verification</em>' etc, but surprisingly, <strong><em>the REST API does not have any endpoint for simple signin / login</em></strong>.</p>
  
  <hr>
  
  <p>From <a href="http://docs.aws.amazon.com/cli/latest/reference/cognito-idp/index.html#cli-aws-cognito-idp" rel="noreferrer">Cognito CLI API docs</a> I have all the OFFICIAL CLI APIs necessary to "<em>signup users</em>", "<em>confirm signups</em>", "<em>change passwords</em>", "<em>verify phone numbers</em>", "<em>forgot passwords</em>" etc. <strong><em>Surprisingly there is no CLI API mentioned for LOGINs.</em></strong> I was hoping there should be some CLI API like "<strong><em><code>$ aws cognito-idp log-in</code></em></strong>" just like there is for "<strong><em><code>$ aws cognito-idp sign-up</code></em></strong>" or for "<strong><em><code>$ aws cognito-idp forgot-password</code></em></strong>" etc.</p>
  
  <hr>
  
  <p>Also from <a href="http://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html" rel="noreferrer">this getting started tutorial</a> it talks about "*what should be done with tokens received <strong><em>AFTER</em></strong> successful authentication of a user*". However, it doesn't talk about <strong><em>HOW TO</em></strong> make the successful authentication happen on the first place with Cognito User Pool APIs. Examples are available only for Android, iOS, javascript SDKs. There are no authentication examples available for platforms which do not have SDKs.</p>
  
  <hr>
  
  <p>Hence, <strong><em>How do i make logins happen via Amazon Cognito REST APIs (for user pools) on platforms for which there is no official SDK?</em></strong></p>