question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auth.federatedIdentitySignIn({provider: 'Google'}) not working

See original GitHub issue

Describe the bug When I try to use Auth.federatedIdentitySignIn({provider: 'Google'}); in my code it throws the error: "Argument of type ‘{ provider: string; }’ is not assignable to parameter of type ‘FederatedSignInOptionsCustom’. Object literal may only specify known properties, and ‘provider’ does not exist in type ‘FederatedSignInOptionsCustom’.`

When I use Auth.federatedIdentitySignIn(); by itself it works fine, but I would like to skip the step of clicking the button.

To Reproduce run npm i aws-angular run following code in a typescript/angular file: import Amplify, { Auth } from 'aws-amplify'; const oauth = { domain: 'XXXXXX.auth.us-east-1.amazoncognito.com/', scope: ['email', 'profile', 'openid'], redirectSignIn: 'http://localhost:4200/', redirectSignOut: 'http://localhost:4200/', responseType: 'token' };

Amplify.configure({ Auth: { oauth: oauth, region: environment.AWS_REGION, userPoolId: environment.AWS_USER_POOL_ID, userPoolWebClientId: environment.CLIENT_ID, } });

ngOnInit() { Auth.federatedSignIn({provider: 'Google'}); }

Expected behavior It should redirect to an option to sign in with a google email listing all the user’s google accounts.

Desktop (please complete the following information):

  • OS: iOS
  • Browser: chrome

Running in visual studio code if that helps at all

aws-amplify version: 1.1.29 @aws-amplify/auth version: 1.2.25 @aws-amplify/core version: 1.0.28

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

138reactions
manueliglesiascommented, Jul 9, 2019

@colehendo

Can you try like this?

import { CognitoHostedUIIdentityProvider } from "@aws-amplify/auth/lib/types";

Auth.federatedSignIn({
  provider: CognitoHostedUIIdentityProvider.Google
});
5reactions
erislandycommented, Jun 24, 2021

Hi, try with this Auth.federatedSignIn({ customProvider: “Google” });

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amplify/Cognito oauth federated sign-in (Google) ,does not ...
On the client side, we are using Amplify to sign-in sign-out etc. During the sign in, I call the Amplify federatedSignIn method with...
Read more >
Complex Sign-in user flows made easy on Android with ...
In the console, turn on the Email/Password and Google Sign-In providers. It should look like this: Now click the 'Add Firebase Authentication to ......
Read more >
Authentication - Advanced workflows - JavaScript - Amplify Docs
federatedSignIn() to get AWS credentials directly from Cognito Federated Identities and not use User Pool federation. If you have logged in with Auth....
Read more >
How to use the @aws-amplify/auth.federatedSignIn function in ...
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >
Here's How To Add Google Sign-in To Your React Native App ...
... to implement AWS Amplify Auth in my React Native app, I ran into some problems. ... Select the auth providers you'd like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found