title: AWS amplify set currentSession and currentAuthenticatedUser using Ionic Auth Connect
body: <p><strong>Setup</strong></p>
  <p>I'm developing an ionic app that use AWS Amplify as backend. We want to use the following services using both auth types &quot;AMAZON_COGNITO_USER_POOLS&quot; and &quot;API_KEY&quot;:</p>
  <ul>
  <li>Amplify API for to interact with API Gateway</li>
  <li>GraphQL API with codegen</li>
  </ul>
  <p>For authentication we are using <a href="https://ionic.io/docs/auth-connect/auth-connect-angular" rel="nofollow noreferrer">Ionic Auth Connect</a> with Cognito hosted UI. Following the docs we were able to have login and registration working with ability to retrieve Id, Refresh and Access token.</p>
  <p><strong>Problem</strong></p>
  <p>The problem with this setup is that amplify is not able to recognize logged in users and we are getting no current user error when trying to interact with Amplify API and GraphQL.</p>
  <p>Checking both amplify and auth connect docs I found no clear way to set current user manually.</p>
  <p>I tried setting the tokens manually using <strong>Amplify.configure</strong> and using an auth interceptor but it did not work because Amplify has some validation logic within the SDK which blocks the request.</p>
  <p>Is there a way to set user session for amplify without having to manually construct API and GraphQL calls ?</p>