title: AWS Amplify Invalid Grant
body: <p>I am using Angular 9 for the front end of my application. I am using AWS Amplify for user authentication. I am trying to intergrate google sign up with my application. I am able to log the user in with google but  I seem to be getting an invalid grant error when the user is redirected after sign in.</p>
  <pre><code>POST **domain_name** 400
  
  ConsoleLogger.js:107 [ERROR] 54:09.165 OAuth - Error handling auth response. Error: invalid_grant
  at OAuth.&lt;anonymous&gt; (OAuth.js:186)
  at step (OAuth.js:56)
  at Object.next (OAuth.js:37)
  at fulfilled (OAuth.js:28)
  at ZoneDelegate.invoke (zone-evergreen.js:364)
  at Zone.run (zone-evergreen.js:123)
  at zone-evergreen.js:857
  at ZoneDelegate.invokeTask (zone-evergreen.js:399)
  at Zone.runTask (zone-evergreen.js:167)
  at drainMicroTaskQueue (zone-evergreen.js:569)
  </code></pre>
  <p>I am using <code>Auth.federatedSignIn</code> method to in my front end to call the API. Here is the relevant component code in <code>auth.component.ts</code></p>
  <pre><code>  import { Component, OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
    import { Amplify } from &quot;aws-amplify&quot;;
    import Auth, { CognitoHostedUIIdentityProvider } from &quot;@aws-amplify/auth&quot;;
    import { onAuthUIStateChange, CognitoUserInterface, AuthState, FormFieldTypes } from '@aws-amplify/ui-components';
  
  async signInWithGoogle() {
  console.log(&quot;signInWithGoogle called&quot;);
  try {
    Auth.federatedSignIn({'provider': CognitoHostedUIIdentityProvider.Google}).then(
      cred =&gt; {
        this.authState = AuthState.SignedIn;
        console.log(cred);
      }
    ).catch(
      e =&gt; {
        // console.log(e);
  
      }
    );
  } catch (error) {
    console.log(&quot;Error Calling signInWithGoogle&quot;);
  
  }
  </code></pre>
  <p>}</p>
  <p>Then I have a button which calls <code>signInWithGoogle()</code> on click. Upon the using choosing their google account, the aforementioned error is called. Also, I am only calling <code>Amplify.configure(awsconfig);</code> once in my app.module.ts file.</p>