https://serverless-stack.com/ logo
#help
Title
# help
e

Ernie Francis

02/18/2022, 8:53 PM
for the sst stack, there is no way to add 'UserPoolIdentityProvider' inside the Auth constructor? do i have to use AWS-CDK-LIB?
a

Ashishkumar Pandey

02/18/2022, 9:16 PM
Here’s how you can achieve it with the
Auth
construct - https://docs.serverless-stack.com/constructs/Auth#userpool
f

Frank

02/18/2022, 9:38 PM
@Ashishkumar Pandey that sets up Identity Pool federation, not the user pool identity provider… (SUPER confusing)
@Ernie Francis did the code snippet I shared yesterday not work?
Copy code
const auth = new sst.Auth(this, 'Auth', {
      cognito: {
        userPool: {
          signInAliases: { email: true },
        },
      },
    });

    const testy = new cdk.aws_cognito.UserPoolIdentityProviderGoogle(this, 'testy', {
      clientId: "...",
      clientSecret: "...",
      userPool: auth.cognitoUserPool,
      attributeMapping: {
        ...
      }
    });
a

Ashishkumar Pandey

02/18/2022, 9:42 PM
Interesting what’s the difference in these two approaches, @Frank?
f

Frank

02/23/2022, 11:08 PM
Setting social logins in the User Pool stores the (ie. Google users) in ur pool, and u can configure attribute mapping (ie. Google user’s email will be saved as User Pool user’s username)
Enabling Google in Identity Pool allow u to grant a temporary IAM credential to the google user. But google users aren’t saved in ur user pool. In fact u don’t even need user pool in this context.
a

Ashishkumar Pandey

02/28/2022, 9:21 AM
Thank you for explaining, got it!
5 Views