Auth Service

gRPC-based authentication service supporting Passkeys (WebAuthn/FIDO2), Google OAuth, API Keys, and Service Accounts with multi-tenant organization support.

Service Architecture

ProtocolPortDescription
gRPC50051Primary API (Tonic/Prost)
HTTP8080Health checks only

Authentication Methods

Human Authentication

MethodStatusDescription
Passkey (WebAuthn)PrimaryFIDO2 credentials with biometric verification
Google OAuthAvailableSocial login via Google ID tokens
Magic LinkDisabledEmail provider not configured

Machine Authentication

MethodFormatDescription
API Keystenzro_k_[64-char]Long-lived keys with scopes (read, write, admin)
Service Accountssa_[16-char]OAuth 2.0 Client Credentials for M2M

gRPC Endpoints

Session Management

MethodDescription
CreateSessionCreate new session with JWT access + refresh tokens
ValidateSessionVerify JWT token is valid and not revoked
RefreshSessionGet new access token using refresh token
RevokeSessionInvalidate session

Passkey / WebAuthn

MethodDescription
StartPasskeyRegistrationBegin passkey registration, get challenge
CompletePasskeyRegistrationComplete registration with credential
StartPasskeyAuthenticationBegin passkey auth, get challenge
CompletePasskeyAuthenticationComplete auth with signature
ListPasskeysList user's registered passkeys
RemovePasskeyDelete a passkey

OAuth

MethodDescription
VerifyOAuthTokenValidate Google ID token, create session

API Keys

MethodDescription
CreateApiKeyGenerate new API key (secret returned only once)
ValidateApiKeyVerify API key, create session
RevokeApiKeyDeactivate API key
ListApiKeysList owner's API keys
RotateApiKeyGenerate new key, revoke old one

Service Accounts

MethodDescription
CreateServiceAccountCreate service account (secret returned only once)
AuthenticateServiceAccountLogin with client_id + client_secret
GetServiceAccountRetrieve service account details
UpdateServiceAccountModify service account
DeleteServiceAccountDeactivate service account
ListServiceAccountsList service accounts
RotateServiceAccountSecretGenerate new secret

Organizations (Sub-Tenants)

MethodDescription
CreateOrganizationCreate organization, owner auto-added
GetOrganizationRetrieve organization
UpdateOrganizationModify organization
DeleteOrganizationDeactivate organization
ListOrganizationsList organizations with pagination
AddUserToOrganizationAdd member with role
RemoveUserFromOrganizationRemove member
ListOrganizationMembersList members with role filter

JWT Token Structure

Access tokens use HS256 (HMAC-SHA256) with the following claims:

{
  "sub": "user_id",
  "sid": "session_id",
  "aud": "application_id",
  "iat": 1705312800,
  "exp": 1705399200,
  "token_type": "access"
}

Token Expiration

Token TypeValidity
Access Token24 hours
Refresh Token30 days
API Key Session1 hour
Service Account Session1 hour

Organization Tiers

TierDescription
freeBasic access
starterSmall teams
professionalGrowing organizations
enterpriseFull features, Canton integration

Organization Member Roles

RolePermissions
ownerFull control, billing, delete organization
adminManage members, settings
memberStandard access
viewerRead-only access

API Key Scopes

ScopeDescription
readRead-only operations
writeCreate and modify resources
adminAdministrative operations

Security Features

  • WebAuthn challenge expiration: 10 minutes
  • Cloning detection via passkey counter field
  • JWT secret minimum: 32 characters
  • API keys stored as SHA-256 hashes only
  • Service account secrets stored as SHA-256 hashes only
  • IP address hashing for session tracking