---
updatedAt: 2025-08-12T00:13:47.000Z
agentTools:
  projectIndex: https://docs.pelcro.com/v2.4/llms.txt
---

# Tecnavia

The Pelcro–Tecnavia integration enables **single sign-on (SSO)** from Tecnavia e-Edition properties to Pelcro-managed subscriber accounts using a **token-based (JWT) workflow**. Tecnavia makes a server-to-server POST to Pelcro; Pelcro validates the token, enforces site access, and returns an XML result Tecnavia expects (e.g., `<LOGIN>...`). This aligns with **Tecnavia “Option 3 – API / 3rd party login”** (server-to-server verification with XML replies).

***

## When to Use

Use this integration if you:

* Want **real-time** auth against Pelcro (no CSV/file uploads).
* Already manage subscribers in Pelcro and need Tecnavia to defer to Pelcro for access decisions.
* Prefer a **token (JWT)** flow over Tecnavia’s legacy username/password+MD5 variant (Pelcro implements the token form; no MD5 password exchange is required).

***

## Endpoint

```
POST /v1/core/authenticate/tecnavia
```

**Purpose:** Validate a Tecnavia-provided token, check site-level permissions, and return an XML `<LOGIN>` response.

***

## Request

### Parameters

| Name      | Required | Type   | Notes                                                                                                                    |
| --------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
| `token`   | Yes      | String | JWT to be validated by Pelcro. Encodes/identifies the Pelcro user.                                                       |
| `site_id` | No       | String | If present, auth is validated against this Pelcro site; otherwise Pelcro uses the user’s first associated customer site. |

> **Transport:** Server-to-server POST from Tecnavia to Pelcro. (This mirrors Tecnavia Option 3’s server-to-server verification model.)

### Example (form-encoded)

```bash
curl -X POST https://api.pelcro.com/v1/core/authenticate/tecnavia \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
  --data-urlencode 'site_id=1234'
```

***

## Processing (Pelcro Core)

1. **Token validation (JWT)**
   * Verify the JWT via `JWTAuth`.
   * Extract Pelcro `user_id`; fetch the user.

2. **Site access control**
   * If `site_id` given: verify user has access to that site.
   * If omitted: default to the user’s first associated customer site.
   * Enforce permissions via Laravel **Gate** (API read access).

3. **Response generation (XML)**
   * Return `<LOGIN>` XML reflecting auth outcome and, if successful, user info.
   * Appropriate HTTP status codes on error.

***

## Response (XML)

Pelcro returns XML in the structure Tecnavia’s Option 3 expects (server-to-server “LOGIN” verification).

### Success

```xml
<?xml version="1.0"?>
<LOGIN>
  <TOKEN>REQUEST_TOKEN_ECHOED_OR_SESSION_TOKEN</TOKEN>
  <UNIQUE_USER_ID>pelcro_user_id</UNIQUE_USER_ID>
  <EMAIL>user@example.com</EMAIL>
  <USERNAME>John Doe</USERNAME>
  <IS_LOGGED>Yes</IS_LOGGED>
  <FOD>1111100</FOD>
</LOGIN>
```

* **TOKEN**: Echo of the incoming token or session identifier expected by Tecnavia.
* **UNIQUE\_USER\_ID**: Stable Pelcro user identifier (mapped to Tecnavia’s `UNIQUE_USER_ID`).
* **EMAIL**, **USERNAME**: Optional display fields for Tecnavia UI.
* **IS\_LOGGED**: `Yes` / `No` / `2Many` (too many concurrent logins per Tecnavia spec).
* **FOD**: 7-char binary string (Sun→Sat). `1` = delivery; `0` = no delivery. Example: `1111100` = Sun–Thu delivery.

### Failure

```xml
<?xml version="1.0"?>
<LOGIN>
  <TOKEN></TOKEN>
  <UNIQUE_USER_ID></UNIQUE_USER_ID>
  <IS_LOGGED>No</IS_LOGGED>
</LOGIN>
```

This mirrors Tecnavia’s “invalid/expired token” example.

***

## HTTP Status Codes

| Code | Meaning      | Typical Cause                                         |
| ---- | ------------ | ----------------------------------------------------- |
| 200  | OK           | Token valid; XML `<LOGIN>` with `IS_LOGGED=Yes`.      |
| 400  | Bad Request  | Missing `token`.                                      |
| 401  | Unauthorized | Invalid/expired JWT.                                  |
| 403  | Forbidden    | User lacks access to `site_id` (or no eligible site). |
| 404  | Not Found    | User referenced by token not found.                   |
| 500  | Server Error | Unhandled error during verification.                  |

***

## Field Mapping (Pelcro → Tecnavia)

| Tecnavia XML Field | Pelcro Source                                  | Notes                                      |
| ------------------ | ---------------------------------------------- | ------------------------------------------ |
| `TOKEN`            | Request `token` (echo) or Pelcro session token | Echo recommended per Tecnavia flow.        |
| `UNIQUE_USER_ID`   | Pelcro user ID                                 | Stable identifier Tecnavia will reference. |
| `EMAIL`            | Pelcro user email                              | Optional but useful for Tecnavia UI.       |
| `USERNAME`         | Pelcro name / username                         | Optional.                                  |
| `IS_LOGGED`        | Result flag                                    | `Yes`/`No`/`2Many` (per Tecnavia).         |
| `FOD`              | Derived from subscription                      | 7-bit schedule string Sun→Sat.             |

***

## Security Notes

* **JWT validation**: Standard signature/expiry checks.
* **Authorization**: Site-scoped via Laravel Gate before granting access.
* **No password exchange**: Pelcro does **not** implement Tecnavia’s MD5+seed password variant; use the **token (JWT)** approach of Option 3.

***

## Tecnavia Context & Compatibility

* **Option 3 – API / 3rd party login**: Tecnavia initiates a server-to-server POST and expects an XML `<LOGIN>` reply with fields shown above (examples and DTD in Tecnavia docs).
* **Option 2 – File transfer**: CSV/TXT batch provisioning is not part of this Pelcro integration (Pelcro focuses on real-time auth).
* **Redelivery tokens**: Tecnavia supports “redelivery” date-scoped tokens. Out of scope for Pelcro’s endpoint, but compatible as long as Tecnavia still calls the Pelcro auth endpoint to validate access.

***

## Example: Minimal Integration (Tecnavia → Pelcro)

1. **User signs in** on publisher site (Pelcro manages identity).
2. **Tecnavia requests**: `POST /v1/core/authenticate/tecnavia` with `token` (JWT) and optional `site_id`.
3. **Pelcro responds** with `<LOGIN>` XML.
4. **Tecnavia grants/denies** e-Edition based on `IS_LOGGED` and optional `FOD`/user fields.

***

## Changelog

* **v1.0** — Initial publication: JWT-based Option-3 compatibility, XML `<LOGIN>` responses, site-scoped authorization.

# Sibling pages

* [Disqus](https://docs.pelcro.com/v2.4/docs/disqus.md)
* [Milibris](https://docs.pelcro.com/v2.4/docs/milibris.md)
* [Vimeo](https://docs.pelcro.com/v2.4/docs/vimeo.md)
* [Zinio](https://docs.pelcro.com/v2.4/docs/zinio.md)