Skip to content

fix(authentication): fixed terminal state persistence for redirect response #8916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sahkal
Copy link
Contributor

@sahkal sahkal commented Aug 12, 2025

Type of Change

  • Bugfix

Description

fixed terminal state persistence for redirect respon

How did you test it?

Create authentication

curl --location 'localhost:8080/authentication' \
--header 'X-Profile-Id: pro_wcFayhnIqtY4jZXAd2HN' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_pP7xcq6gwvuGOx0Pn6ecfWvfIF3wcjmMtyTshoMffoRsEif1vrDqJaRMO9hwyaHr' \
--data '{
    "amount": 10,
    "currency": "USD",
    "acquirer_details": {
        "acquirer_merchant_id": "12134",
        "acquirer_bin": "438309",
        "merchant_country_code": "004"
    },
    "authentication_connector":"juspaythreedsserver"
}'

Eligibility

curl --location 'localhost:8080/authentication/authn_JkeGGbnXvwwHYhhko7rH/eligibility' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_pP7xcq6gwvuGOx0Pn6ecfWvfIF3wcjmMtyTshoMffoRsEif1vrDqJaRMO9hwyaHr' \
--data-raw '{
     "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4916994064252017",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "CA",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "PiX"
        },
        "phone": {
            "number": "123456789",
            "country_code": "12"
        }
    },
    "email": "[email protected]",
    "browser_information": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "115.99.183.2"
    },
}'

Authenticate Via BRW

curl --location 'localhost:8080/authentication/authn_JkeGGbnXvwwHYhhko7rH/authenticate' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_pP7xcq6gwvuGOx0Pn6ecfWvfIF3wcjmMtyTshoMffoRsEif1vrDqJaRMO9hwyaHr' \
--data '{
    "device_channel": "BRW",
    "threeds_method_comp_ind": "Y"
}
'

Trigger otp

curl --location 'https://mock-three-ds-server-small-lake-1937.fly.dev/processor/mock/acs/trigger-otp?redirectUrl=http%3A%2F%2Flocalhost%3A8080%2Fauthentication%2Fsahkal11%2Fauthn_JkeGGbnXvwwHYhhko7rH%2Fsync' \
--header 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'cache-control: no-cache' \
--header 'content-type: application/x-www-form-urlencoded' \
--header 'origin: https://juspay-3ds-sdk.netlify.app' \
--header 'pragma: no-cache' \
--header 'priority: u=0, i' \
--header 'referer: https://juspay-3ds-sdk.netlify.app/' \
--header 'sec-ch-ua: "Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: iframe' \
--header 'sec-fetch-mode: navigate' \
--header 'sec-fetch-site: cross-site' \
--header 'sec-fetch-storage-access: active' \
--header 'upgrade-insecure-requests: 1' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36' \
--data-urlencode 'creq={"messageType":"CReq","threeDSServerTransID":"2e23c720-f2bd-4457-87f0-6d3b2cdbba92","acsTransID":"5cc1758d-0f65-4544-9891-e9fb7c49cca7","challengeWindowSize":"01","messageVersion":"2.2.0"}'

Sync

curl --location 'localhost:8080/authentication/sahkal11/authn_w5xUrPaBuD3R7oYxTvbC/sync' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_pP7xcq6gwvuGOx0Pn6ecfWvfIF3wcjmMtyTshoMffoRsEif1vrDqJaRMO9hwyaHr' \
--data '{
}'

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@sahkal sahkal added this to the July 2025 Release milestone Aug 12, 2025
@sahkal sahkal self-assigned this Aug 12, 2025
@sahkal sahkal added the C-bug Category: Bug label Aug 12, 2025
@sahkal sahkal requested a review from a team as a code owner August 12, 2025 06:04
Copy link

semanticdiff-com bot commented Aug 12, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/common_enums/src/enums.rs  0% smaller
  crates/router/src/core/unified_authentication_service.rs  0% smaller

@sahkal sahkal requested a review from a team as a code owner August 12, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants