title: AWS Cognito user: Device confirmation failed
body: <p>I am using CognitoAuth library from Amazon to manage user authentication.
  In the AWS console, the "Do you want to remember your user's devices?" option is set to 'Always'.
  But when I call getSession method on a CognitoUse object, in onSuccess callback, I always do get 'newDevice' param as null. It is supposed to be not null because the option to remember device is enabled. Because of that I cannot refresh the token and getting the exception below:</p>
  
  <pre><code>Device confirmation failed: 
  com.amazonaws.mobileconnectors.cognitoidentityprovider.exceptions.CognitoNotAuthorizedException: User is not authenticated
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.getCachedSession(CognitoUser.java:981)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.confirmDevice(CognitoUser.java:3287)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.handleChallenge(CognitoUser.java:2607)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.respondToChallenge(CognitoUser.java:2409)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser$24.run(CognitoUser.java:2480)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation.continueTask(AuthenticationContinuation.java:124)
      at com.amazonaws.mobile.client.AWSMobileClient$6$1.getAuthenticationDetails(AWSMobileClient.java:1177)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.getSession(CognitoUser.java:778)
      at com.amazonaws.mobile.client.AWSMobileClient$6.run(AWSMobileClient.java:1137)
      at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101)
      at java.lang.Thread.run(Thread.java:764)
   Caused by: com.amazonaws.services.cognitoidentityprovider.model.NotAuthorizedException: Invalid Refresh Token. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: NotAuthorizedException; Request ID: ed2f2501-7a36-447f-ac29-c4ab4741958e)
      at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:730)
      at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:405)
      at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:212)
      at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.invoke(AmazonCognitoIdentityProviderClient.java:6292)
      at com.amazonaws.services.cognitoidentityprovider.AmazonCognitoIdentityProviderClient.initiateAuth(AmazonCognitoIdentityProviderClient.java:4277)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.refreshSession(CognitoUser.java:2378)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.getCachedSession(CognitoUser.java:976)
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.confirmDevice(CognitoUser.java:3287) 
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.handleChallenge(CognitoUser.java:2607) 
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.respondToChallenge(CognitoUser.java:2409) 
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser$24.run(CognitoUser.java:2480) 
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.continuations.AuthenticationContinuation.continueTask(AuthenticationContinuation.java:124) 
      at com.amazonaws.mobile.client.AWSMobileClient$6$1.getAuthenticationDetails(AWSMobileClient.java:1177) 
      at com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser.getSession(CognitoUser.java:778) 
      at com.amazonaws.mobile.client.AWSMobileClient$6.run(AWSMobileClient.java:1137) 
      at com.amazonaws.mobile.client.internal.InternalCallback$1.run(InternalCallback.java:101) 
      at java.lang.Thread.run(Thread.java:764) 
  </code></pre>
  
  <p>Why is no CognitoDevice object received? How to resolve this?</p>