Auth.federatedIdentitySignIn({provider: 'Google'}) not working
See original GitHub issueDescribe 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:
- Created 4 years ago
- Reactions:1
- Comments:11 (2 by maintainers)
Top GitHub Comments
@colehendo
Can you try like this?
Hi, try with this Auth.federatedSignIn({ customProvider: “Google” });