0

I'm trying to redirect to client application login page when the user clicks on the Account Confirmation email link. The URL which i'm redirecting to is https:///accountrecoveryendpoint/confirmregistration.do?confirmation=54166133-0e00-463a-9ecf-ce26b516190a&userstoredomain=USERS&[email protected]&tenantdomain=carbon.super&callback=http://(applicationdomain)/context/openid-connect/wso2_oauth but actually i should be able to get the client id and state parameters in the email link.but these values are missing. Any help would be appreciated

4
  • Why do you need the client id in the params? Oct 24, 2022 at 13:17
  • How are you making the account confirmation request? What I mean was, do you receive this email when a user tries to self-register with the out-of-the-box server capabilities? Do you want to add more parameters to the confirmation link? Oct 24, 2022 at 14:34
  • yes @SomindaGamage, since when the user self registers a confirmation link is sent to the user's email ID, localhost:9443/accountrecoveryendpoint/… so after clicking on this link it is redirecting to user portal application's login page instead of client application login page. So, can u please help here to redirect to client application login page. Jan 13, 2023 at 13:30
  • Can you share a sample account confirmation link that you have received? Jan 26, 2023 at 17:29

1 Answer 1

0

If you are trying to invoke account confirmation using the default identity server UIs, you won't be able to send any additional query parameters in the email because the OOTB UIs does not support sending additional request parameters. Identity server UIs are designed to cater a specific userstories. But this can be easily done using customization.

Example: If you are trying self-registering using the REST API, instead of the default self-registration page, you can do this easily by making a small change to the request. Sample API request as follows. Note here that I have added a custom param to the request.

curl -L -X POST 'https://localhost:9443/api/identity/user/v1.0/me' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -H 'Content-Type: application/json' --data-raw '{
    "user": {
        "username": "sominda",
        "realm": "PRIMARY",
        "password": "sominda!",
        "claims": [
            {
                "uri": "http://wso2.org/claims/givenname",
                "value": "sominda"
            },
            {
                "uri": "http://wso2.org/claims/emailaddress",
                "value": "[email protected]"
            },
            {
                "uri": "http://wso2.org/claims/lastname",
                "value": "gamage"
            }
        ]
    },
    "properties": [
        {
            "key": "callback",
            "value": "<url_here>"
        },
        {
            "key": "custom-param",
            "value": "templated-custom-param"
        }
    ]
}'

If you are making the above request, then you can edit the AccountConfirmation email template to have the above custom-param templated.

{{carbon.product-url}}/accountrecoveryendpoint/confirmregistration.do?confirmation={{confirmation-code}}&amp;userstoredomain={{userstore-domain}}&amp;username={{url:user-name}}&amp;tenantdomain={{tenant-domain}}&amp;callback={{callback}}&amp;{{custom-param}}

Also, you can customize the existing self-registration page to send the above request (but I think this involves a little effort).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.