# Token Authentication Service Flow
source: https://developer.mastercard.com/mastercard-gateway/documentation/security-and-fraud/authentication/token-auth-service/token-auth-service-flow/index.md

## Overview {#overview}

The following diagram illustrates the high-level flow for a passkey creation and a payment where the payer is authenticated using Token Authentication Service (TAS).

## TAS for Click to Pay flow {#tas-for-click-to-pay-flow}

![](https://static.developer.mastercard.com/content/mastercard-gateway/uploads/TAS_mpgs_flow_2.png)

This flow describes how an online payment works using Mastercard Checkout Solutions (MACS) Click to Pay integrated with the TAS:

1. The merchant or hosted solution initiates a checkout session with Mastercard Gateway.
2. Mastercard Gateway configures Click to Pay.
3. The payer selects Click to Pay as the payment method.
4. The Click to Pay service enables the payer to enroll a new card or use a stored card.
5. The payer selects a card for payment.
6. Mastercard Gateway sends a checkout request indicating successful authentication.
7. The payer successfully completes the authentication challenge initiated by the TAS.
8. The TAS prompts the payer to create a passkey.
9. The payer creates a passkey, which serves as a secure and reusable authentication credential.
10. The TAS binds the newly created passkey to the payer's device.
11. The TAS sends a proof of authentication to the Mastercard Gateway.
12. The merchant or hosted solution updates the session using wallet data.
13. Mastercard Gateway processes the checkout redirecting to TAS.
14. TAS sends back payment credentials, including assurance data and cryptogram to Mastercard Gateway.
15. Mastercard Gateway updates the session with authentication data.
16. The merchant or hosted solution checks for authentication data.
17. If authentication data is present, the payment proceeds without additional authentication.
