for the sst stack, there is no way to add 'UserPoo...
# help
e
for the sst stack, there is no way to add 'UserPoolIdentityProvider' inside the Auth constructor? do i have to use AWS-CDK-LIB?
a
Here’s how you can achieve it with the
Auth
construct - https://docs.serverless-stack.com/constructs/Auth#userpool
f
@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
Interesting what’s the difference in these two approaches, @Frank?
f
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
Thank you for explaining, got it!