Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

106
Visualizações
Amplify Federated Sign In not returning Email for Facebook

I'm using AWS Amplify to add social signing. With google I'm getting the email of the user but it's missing in facebook.

This is my code:

  federatedSignIn(provider: any): void {
    switch (provider) {
      case 'facebook':
          console.log("Authenticating using Facebook");
          Auth.federatedSignIn({ provider: CognitoHostedUIIdentityProvider.Facebook });
          break;
      case 'google':
        console.log("Authenticating using Google");
        Auth.federatedSignIn({ provider: CognitoHostedUIIdentityProvider.Google });
        break;
    }
     
  }

This is what the "Pre sign-up" Lambda sees as an event.

{
    "version": "1",
    "region": "us-east-1",
    "userPoolId": "us-east-xxxxxx",
    "userName": "Facebook_123456",
    "callerContext": {
        "awsSdkVersion": "aws-sdk-unknown-unknown",
        "clientId": "123456abcd"
    },
    "triggerSource": "PreSignUp_ExternalProvider",
    "request": {
        "userAttributes": {
            "email_verified": "false",
            "cognito:email_alias": "",
            "phone_number_verified": "false",
            "cognito:phone_number_alias": ""
        },
        "validationData": {}
    },
    "response": {
        "autoConfirmUser": false,
        "autoVerifyEmail": false,
        "autoVerifyPhone": false
    }
}

Userpool settings enter image description here

enter image description here

Attribute mapping enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The issue was with <amplify-facebook-button> since it uses Identity Pool workflow instead of User Pool workflow. Creating a custom button with federatedSignIn()worked.

  <button  slot="federated-buttons" (click)=customSignIn()>Facebook</button>
  customSignIn(): void{
    Auth.federatedSignIn({provider: CognitoHostedUIIdentityProvider.Facebook });
  } 

More info: https://github.com/aws-amplify/amplify-js/issues/8823

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda