Currently, I am trying to implement Social Login for my web Application using Cognito Aws Service. But I don't want to redirect the user to Cognito Hosted UI for Social Login.
So I use react-google-login for the Google Login and I am getting the callback access token too
<GoogleLogin
clientId="xxxxxxxxxxxxxx.apps.googleusercontent.com"
buttonText="Login"
onSuccess={this.responseGoogle}
onFailure={this.responseGoogleFailure}
cookiePolicy={'single_host_origin'}
/>
responseGoogle = async (response) => {
console.log("response..........", response);
const user = {
name: response.profileObj.name,
email: response.profileObj.email
};
let expires_at = 3600 * 1000 + new Date().getTime()
Auth.federatedSignIn('google', { token: response.tokenId, expires_at }, user).then(credentials => {
console.log(credentials);
});
}
The above code gives the Cognito session values but that doesn't create a user in the user pool.
I have search a lot but didn't find any solutions. I have already referred this below links it refers to my problem. Basically I don't want to use hosted UI for the SocialLogin.
Thank In advance