When using an external service provider (Azure AD) to log into my user pool, my Cognito migrate user lambda never executes

0

I'm having the problem described above. Here are a few things to note:

  • There's no permissions issue. I've validated that the lambda will fire and execute as a post-auth trigger (when testing with a different function handler).
  • My app client is set to use USER_PASSWORD_AUTH instead of SRP.
  • The lambda fires when making an AdminInitiateAuth() call directly from my C# app or the console using (aws cognito-idp admin-initiate-auth) and succeeds.
  • I can see a user being created in the pool after I authenticate, but the lambda just doesn't fire.

I'm out of options. I need to know whether this will work as configured above. If not, I need a possible alternative (post auth trigger to grab some important data from my existing pool)? As it turns out, I don't need the passwords from the existing pool, just some of the attributes.

One thing I noticed: The username displayed in Cognito is always pre-pended with the provider name specified in the UI. I don't know if this matters, but it's not the desired behavior. I want the username to reflect the NAMEID in my SAML, but Cognito doesn't seem to care and throws the provider name in front of it automatically.

1개 답변
0
수락된 답변

I figured this out. Federated login with Cognito does not support the user migration lambda trigger at all, and you have to use a different trigger (like post confirmation). This was not clear without a deep dive into the documentation.

답변함 3달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠