Skip to main content

generate_otp

Function generate_otp 

Source
pub async fn generate_otp(
    _admin: AdminAuth,
    __arg1: State<Arc<AppState>>,
    __arg2: Json<GenerateOtpRequest>,
) -> Response
Expand description

POST /admin/otp/generate — Generate a new OTP.

RHELBU-3536 R9: Creates a new one-time password bound to the specified entity identifier.

§Request

{
  "entity_id": "device-001.example.com",
  "ttl_seconds": 7200,
  "max_usage": 1
}

§Response

{
  "token": "kE9x...",
  "entity_id": "device-001.example.com",
  "expires_at": "2026-06-22T20:00:00Z",
  "max_usage": 1
}

The token field contains the actual OTP value. It is returned exactly once and cannot be retrieved later.