FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour Architectural Sketch – PHP Secure Proxy vs. JWT
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Architectural Sketch – PHP Secure Proxy vs. JWT
Posted: Thu Feb 05, 2026 07:47 AM

This comparison shows two common ways to connect a browser UI with backend microservices.
Both are valid, but they solve different problems.


---

Variant A: PHP Secure Proxy (Gateway Pattern)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Browser  β”‚
β”‚ (Session) β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
      β”‚  JSON (report, params)
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   PHP Proxy   β”‚
│───────────────│
β”‚ - Session     β”‚
β”‚ - Roles       β”‚
β”‚ - Validation  β”‚
β”‚ - Audit log   β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚  JSON + service token
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Harbour Microserviceβ”‚
│────────────────────│
β”‚ - Business logic    β”‚
β”‚ - DBF access        β”‚
β”‚ - No user login     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core idea:
👉 The browser trusts PHP.
👉 The microservice trusts only PHP.

PHP acts as the authority and security boundary.


---

Variant B: JWT Direct Access

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Browser  β”‚
β”‚   (JWT)   β”‚
β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
      β”‚  JSON + JWT
      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Harbour Microserviceβ”‚
│────────────────────│
β”‚ - JWT validation   β”‚
β”‚ - Role checks      β”‚
β”‚ - Business logic   β”‚
β”‚ - DBF access       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core idea:
👉 The browser carries the trust.
👉 Each service validates the token itself.


---

Visual comparison (simplified)

PHP Proxy:
[Browser] β†’ [Central Control] β†’ [Services]

JWT:
[Browser + Trust] β†’ [Services]

---

One-sentence explanation

With a PHP Secure Proxy, authority is centralized in the gateway;
with JWT, authority is decentralized and carried by the token.


---

When each model fits best

PHP Secure Proxy

  • internal or controlled systems
  • ERP / hotel software / industry solutions
  • legacy backends (DBF, C, Harbour)
  • strong audit and traceability requirements
  • clear security boundary

JWT

  • public APIs
  • mobile apps
  • many independent services
  • fully stateless architectures
  • maximum horizontal scalability

---

Important note: not an β€œeither/or”

These approaches do not exclude each other.

A common hybrid model:

  • PHP Secure Proxy at the edge
  • JWT or shared secrets inside the service layer

---

Conclusion

JWT primarily solves a distribution and scaling problem.

A PHP Secure Proxy primarily solves a control, security, and auditability problem.

The better choice depends on system context, not on trends.

For administrative software, a PHP Secure Proxy often feels simpler and more elegant. It centralizes control, embraces state where it already exists, and allows backend services to focus purely on business logic instead of authentication mechanics. That’s why I chose this approach for WINHOTEL Gold Edition.

Continue the discussion