Generic HTTP context server
Connect Airgate to any REST or HTTP API with a Generic HTTP context server, and call it from policy with templated HTTP actions.
A Generic HTTP context server lets Airgate call any REST or HTTP API from policy: a chat webhook, an ITSM, an SMS gateway, a scanner, your own service. This page explains what the server type supports and how to build an action on it.
Status: Available. HTTP actions (context actions) run by HTTP enforcement profiles after an authentication decision. No device sync and no automatic session-based calls.
How it works
Section titled “How it works”- The context server holds the Base URL, the credentials and the shared headers and parameters. Credentials, server headers and sensitive parameters are only sent to the base URL’s origin.
- A context action on the server holds the method, URL, body, headers and response mapping. Its templates are expanded per request.
- An HTTP enforcement profile in an access rule runs the action after the decision (Accept or Reject). Each run is written to the Execution log.
Authentication
Section titled “Authentication”| Authentication | What Airgate sends |
|---|---|
| None (default) | Nothing |
| Basic / user + password | Authorization: Basic … from Username and Password |
| Bearer token | Authorization: Bearer <token> |
| API key | X-API-Key: <key>. Change the header with API key header and add a prefix with API key prefix (for example Token ). |
| OAuth2 client credentials | A token from Token URL (client credentials grant, optional Scope), cached until it expires, sent as Authorization: Bearer …. Client authentication: Form body (default) or HTTP Basic header. |
Connection test
Section titled “Connection test”Test connection sends GET to Test path (a path or an absolute
URL; empty = the base URL). Any answer other than 401, 403 or 5xx
counts as reachable, and the result shows “reachable (HTTP N)”.
Before you begin
Section titled “Before you begin”- The API’s base URL, reachable from Airgate over HTTPS.
- Credentials for the API, if it needs any.
- An Airgate administrator with
admin:write.
Step 1: Add the context server
Section titled “Step 1: Add the context server”- Open Settings › Webhooks, select the Context servers tab and Add context server.
- Choose Generic HTTP.
- Fill in Name, Base URL (for example
https://api.contoso.com), Authentication and the credentials. Optional: Test path, Server headers, Server parameters, Trusted CA certificate(s) and Timeout per attempt (s) (default 10). - Save, then select Test connection on the server row.
Step 2: Add an action
Section titled “Step 2: Add an action”- Select the Context actions tab and Add action.
- Optional: pick a preset under Start from a preset. Slack message and Microsoft Teams message are built for Generic HTTP servers.
- Pick the Context server and fill in Name, Method, URL
(relative to the base URL, an absolute URL, or
%{param}), Content type and Body.
Example: post a message to an internal service when a device is placed in a quarantine role.
| Field | Value |
|---|---|
| Method | POST |
| URL | /v1/events |
| Content type | application/json |
| Body | {"user": "%{Authentication:Username}", "mac": "%{Connection:Client-Mac-Address}", "role": "%{Tips:Role}", "ssid": "%{Connection:SSID}"} |
Templates:
%{Namespace:Attribute}takes a value from the request, for example%{Authentication:Username},%{Connection:Client-Mac-Address},%{Connection:Client-IP-Address},%{Tips:Role},%{Endpoint:Category}.- Bare
%{name}takes a parameter of the action or the server. Built-in parameters filled from the request:ip,user,full-username,mac,machine,role,posture,category,nas-ip,ssid,domain,requestid. - Values are encoded for the content type (JSON, XML, form, URL). Unresolved references become empty. Credential attributes are never available.
- Response attributes write values from a 2xx JSON answer to the device (JSON path → Endpoint attribute).
- Save, then select Test on the action row: enter a Client MAC, Username or Client IP and select Render only (nothing is sent) or Send request.
Step 3: Run the action from policy
Section titled “Step 3: Run the action from policy”Create an HTTP enforcement profile with {"context_action_id": "<id>"}
and add it to an access rule. The Access policies page does not offer
HTTP profiles yet, so this is done through the API; see
Webhooks and HTTP actions, Step 3.
Verify
Section titled “Verify”- Settings › Webhooks › Execution log lists each run with Source
policy, the HTTP status and the request and response. - The Integrations tab shows Context actions (24h) and the Action queue.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
Test: authentication rejected (HTTP 401) |
Wrong credentials or header. | Check Authentication, API key header and API key prefix. |
Test: server error (HTTP 5xx) |
The API failed, or Test path points at an endpoint that needs a body. | Set Test path to a simple GET endpoint. |
Saving fails: base_url is required for … authentication |
Credentials are bound to the base URL. | Enter Base URL. |
| The URL hint says credentials will not be sent | The action URL is on another origin than the base URL. | Use a relative URL, or a server whose base URL matches. |
| Execution log: value missing in the body | The reference did not resolve for that request. | Check the reference in the test panel with Render only. |