Skip to content
bitzorcas
EN

Concept

Authentication

Three-scheme authentication — JWT Bearer for user callers, HMAC for application callers, API Key with SHA-256 hashed storage, and PolicyScheme forwarding.

Last updated

BitzOrcas uses a three-scheme authentication model with automatic forwarding based on request headers. The PolicyScheme (MultiScheme) selects the correct handler based on which header is present.

Scheme forwarding

Request arrives
├── Has X-Signature header? → HMAC scheme
├── Has X-API-Key header? → API Key scheme
└── Otherwise → JWT Bearer scheme

JWT Bearer (User callers)

For interactive user authentication:

ParameterSourceValidation
Jwt:SecretConfigurationRequired, ≥ 32 characters
Jwt:IssuerConfigurationRequired, validated
Jwt:AudienceConfigurationRequired, validated
ClockSkewHardcodedTimeSpan.Zero (no tolerance)
{
"Jwt": {
"Secret": "your-secret-at-least-32-characters-long",
"Issuer": "bitzorcas-api",
"Audience": "bitzorcas-client"
}
}

JWT claims

ClaimDescription
sub / user_idUser identifier
tenant_idTenant identifier
rolesAssigned roles
expExpiration (UTC)
iatIssued at (UTC)

HMAC (Application callers)

For server-to-server authentication:

ComponentDescription
HeaderX-Signature
AlgorithmHMAC-SHA256
CredentialsHmac:Clients configuration
NonceAnti-replay via INonceStore
Fail-closedUnregistered clients → 401
{
"Hmac": {
"Clients": {
"service-a": "shared-secret-here",
"service-b": "another-secret"
}
}
}

HMAC request signing

  1. Client constructs canonical request string
  2. Computes HMAC-SHA256 with shared secret
  3. Sends X-Signature: {timestamp}.{signature}
  4. Server validates signature and nonce (anti-replay)

API Key (Application callers)

Simple key-based authentication for service integration:

ComponentDescription
HeaderX-API-Key
StorageSHA-256 hash only (plaintext never stored)
Credential formatprefix_descriptionprefix_identifier
{
"ApiKeys": {
"boa_integration-key": {
"KeyPrefix": "boa",
"TenantId": "100",
"Scopes": ["tickets.read", "tickets.write"]
}
}
}

Development test fixtures

Only in Development mode, test credentials are injected:

  • HMAC: test-client with secret test-secret
  • API Key: boa_test_integration-key with sandbox scopes

See also