> For the complete documentation index, see [llms.txt](https://docs.hyperswitch.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyperswitch.io/integrations/prism/python/payment-method-authentication-service.md).

# Payment Method Authentication Service Overview

## Overview

The Payment Method Authentication Service manages 3D Secure (3DS) authentication flows using the Python SDK. 3DS adds an extra layer of security for online card payments by verifying the cardholder's identity with their bank.

**Business Use Cases:**

* **Fraud prevention** - Shift liability to issuers for authenticated transactions
* **Regulatory compliance** - Meet Strong Customer Authentication (SCA) requirements
* **Risk-based** - Request 3DS for high-risk transactions
* **Global payments** - Required for many European and international transactions

## Operations

| Operation                                                                                                    | Description                                                                       | Use When                                       |
| ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- | ---------------------------------------------- |
| [`pre_authenticate`](/integrations/prism/python/payment-method-authentication-service/pre-authenticate.md)   | Initiate 3DS flow before payment. Collects device data for authentication.        | Starting 3D Secure flow                        |
| [`authenticate`](/integrations/prism/python/payment-method-authentication-service/authenticate.md)           | Execute 3DS challenge or frictionless verification. Performs bank authentication. | After pre\_authenticate, complete the 3DS flow |
| [`post_authenticate`](/integrations/prism/python/payment-method-authentication-service/post-authenticate.md) | Validate authentication results with issuer. Confirms authentication decision.    | After customer completes 3DS challenge         |

## SDK Setup

```python
from hyperswitch_prism import PaymentMethodAuthenticationClient

auth_client = PaymentMethodAuthenticationClient(
    connector='stripe',
    api_key='YOUR_API_KEY',
    environment='SANDBOX'
)
```

## Common Patterns

### 3DS Flow

```mermaid
sequenceDiagram
    participant C as Customer
    participant App as Your App
    participant CS as Prism
    participant Bank as Issuer Bank

    Note over C: Ready to pay
    App->>CS: 1. pre_authenticate
    CS->>Bank: Check device data
    Bank-->>CS: Return: frictionless or challenge
    CS-->>App: Return authentication URL
    alt Challenge Required
        App->>C: Redirect to bank challenge
        C->>Bank: Enter password/SMS code
        Bank-->>App: Return to return_url
    end
    App->>CS: 2. post_authenticate
    CS->>Bank: Validate result
    Bank-->>CS: Authentication result
    CS-->>App: Return 3DS result
    App->>CS: 3. authorize payment
    CS-->>App: Payment complete
```

**Flow Explanation:**

1. **Pre-authenticate** - Start 3DS flow, collect device data, determine frictionless vs challenge.
2. **Challenge (if needed)** - Customer completes bank challenge (password, SMS, etc.).
3. **Post-authenticate** - Validate the authentication result with the bank.
4. **Authorize** - Proceed with payment authorization using 3DS data.

## Frictionless vs Challenge

| Flow             | User Experience      | When It Happens                                 |
| ---------------- | -------------------- | ----------------------------------------------- |
| **Frictionless** | No interruption      | Low risk, returning customer, device recognized |
| **Challenge**    | Customer enters code | High risk, new device, large amount             |

## Next Steps

* [Payment Service](/integrations/prism/python/payment-service.md) - Complete payment after 3DS
* [authorize](/integrations/prism/python/payment-service/authorize.md) - Use 3DS result for authorization

## Additional Resources

* Understanding 3D Secure 2.0
* SCA compliance guide
* Risk-based authentication


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hyperswitch.io/integrations/prism/python/payment-method-authentication-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
