AWS Cognito - Can I use the migration trigger in a Custom auth flow

天大地大妈咪最大 提交于 2019-12-11 08:55:02

问题


I am investigating the recently released migration trigger for cognito user pools. To enable the trigger you need to set the AuthFlow type in the InitiateAuthRequest to be "USER_PASSWORD_AUTH" see here: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-import-using-lambda.html

I want to use the custom auth flow so that I can return a challenge response for email verification is the users are not email verified from the existing user store. However if I set the AuthFlow type to "CUSTOM_AUTH" then the migration trigger is not fired.

Is there a way to get custom auth and migration working at the same time?

Example code:

var client = new AmazonCognitoIdentityProviderClient(Amazon.RegionEndpoint.APSoutheast2);

var authRequest = new InitiateAuthRequest
{
    ClientId = "*********",
    AuthFlow = "USER_PASSWORD_AUTH" // Or AuthFlow = "CUSTOM_AUTH"
};

authRequest.AuthParameters.Add("USERNAME", username);
authRequest.AuthParameters.Add("PASSWORD", password);

var response = await client.InitiateAuthAsync(authRequest);

回答1:


I am on the Cognito team and that is not possible at this point. I can however mention your use case within the team as a feature request.



来源:https://stackoverflow.com/questions/48999092/aws-cognito-can-i-use-the-migration-trigger-in-a-custom-auth-flow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!