'AWS Amplify Google auth user not redirected back

I'm trying to implement Google auth in a React native app using AWS Amplify. I've installed Amplify in my app and also installed Auth.

I have this client in Google apis: enter image description here

Authorised javascript origin:

https://inventory053721f5-053721f5-develop.auth.eu-west-1.amazoncognito.com

Authorised redirect uri:

https://inventory053721f5-053721f5-develop.auth.eu-west-1.amazoncognito.com/oauth2/idpresponse

aws-exports.js:

// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.

const awsmobile = {
    "aws_project_region": "eu-west-1",
    "aws_cognito_identity_pool_id": "***",
    "aws_cognito_region": "eu-west-1",
    "aws_user_pools_id": "***",
    "aws_user_pools_web_client_id": "***",
    "oauth": {
        "domain": "***",
        "scope": [
            "phone",
            "email",
            "openid",
            "profile",
            "aws.cognito.signin.user.admin"
        ],
        "redirectSignIn": "inventory://",
        "redirectSignOut": "inventory://",
        "responseType": "code"
    },
    "federationTarget": "COGNITO_USER_POOLS"
};


export default awsmobile;

My App.tsx looks like this:

import React, {FunctionComponent} from 'react';
import Amplify, {Auth} from 'aws-amplify';
import {Button} from 'react-native';
import config from '../../aws-exports';

Amplify.configure(config);

export interface AppProps {}

const App: FunctionComponent<AppProps> = () => {
  return <Button title={'Login'} onPress={() => Auth.federatedSignIn()} />;
};

export default App;

A video of what happens:

https://imgur.com/tPEcoop



Solution 1:[1]

While this may not be your situation exactly. If you are using the amplify CLI make sure that your redirect signin and signout URIs are set up properly.

You can adjust this by running amplify update auth

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andrew Mangan