Skip to main content

Auth: hbf-lcg

Overview

hbf-lcg uses JWT for inbound authentication and Bearer tokens for outbound service calls. It does not issue tokens.

Inbound Authentication

JWTGuard (upstream endpoints)

All upstream endpoints (gateway-upstream.controller.ts) are protected by @UseGuards(JWTGuard).

  • Algorithm: HS256
  • Secret: JWT_SECRET env var
  • Validation: Verifies signature and checks that the sub claim matches JWT_SUB env var
  • Token source: Authorization: Bearer <token> header

Downstream Helvia Events

Events from hbf-lcm (POST /events/helvia-livechat) are verified via JWT in DownstreamHelviaService. The JWT is extracted from the event payload and validated against JWT_SECRET.

Downstream External Events

Events from Cisco, Genesys, and Zendesk (POST /events/:alias) are not JWT-protected. Authentication relies on the alias routing and provider-specific validation within each downstream service.

Outbound Authentication

TargetAuth MethodConfig
hbf-coreBearer tokenHBF_CORE_API_TOKEN env var
hbf-lcmBearer tokenHBF_LCM_TOKEN env var
hbf-botNoneDirect HTTP POST
Genesys CloudOAuth2 client credentialsPer-tenant plugin config (clientId, clientSecret, region)
Cisco WebExAPI credentialsPer-tenant plugin config
ZendeskAPI credentialsPer-tenant plugin config

Guard Location

  • src/guards/jwt.guard.ts -- JWTGuard implementation
  • src/features/auth/auth.service.ts -- JWT token verification logic