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
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南