I want to redirect to a specific url after the user confirmation in amazon cognito.
When a user sign up he will get confirmation mail with a verification link as follows https://<>.auth.us-west-2.amazoncognito.com/confirmUser?client_id=<<>>&user_name=<<>>&confirmation_code=<<>>
If the user clicks the above link it will redirect to confirmation page.
Once the user confirmation is completed the page should redirect to my application.
Please give me some idea to solve this problem.
Currently, this redirection can't be done using verification link in email. I tried adding redirect_uri to the verification URL a while back but they do not work.
Workaround
These values are passed to backend lambda which makes a GET request to https://your_domain.auth.us-west-2.amazoncognito.com/confirmUser?client_id=somevalue&user_name=some_user&confirmation_code=some_code
On success, return 302 https://myapp.com from your API Gateway
I know this is a convoluted workaround for such a simple requirement. The best way would be to raise a feature request and hope they support a redirect_uri in the Cognito URL.
EDIT
To save your lambda costs, you could also use an HTTP endpoint in your API and make a request to the cognito service endpoint for your region. Example:
POST HTTP/1.1
Host: cognito-idp.us-east-1.amazonaws.com
x-amz-target: AWSCognitoIdentityProviderService.ConfirmSignUp
Content-Type: application/x-amz-json-1.1
{
"ClientId":"xxxxxxxxxxxxx",
"ConfirmationCode":"123456",
"Username":"username"
}