Test and debug your integration
After you integrate your application through any of the integration paths, follow the steps on this page to verify that credentials flow end to end. A working integration means Aembit authorizes the request, your application receives a valid credential, and the target Server Workload: Server Workloads represent target services, APIs, databases, or applications that receive and respond to access requests from Client Workloads.Learn more accepts it.
Whichever path you chose, your Aembit Tenant: Aembit Tenants serve as isolated, dedicated environments within Aembit that provide complete separation of administrative domains and security configurations.Learn more records the full authorization flow for every access request that reaches it, so verification starts in the Tenant and ends at your application. Each path also produces its own local evidence, which the per-path sections on this page cover.
Check authorization events in your Aembit Tenant
Section titled “Check authorization events in your Aembit Tenant”Every integration path produces the same authorization events in your Aembit Tenant, so check them first when access fails. To view them, click Reporting in the left sidebar of your Tenant, which displays the Access Authorization Events page. The events trace each request through four event types: Access Request, Access Authorization, Access Discovery, and Access Credential.
Each authorization event records the identified Client Workload: Client Workloads represent software applications, scripts, or automated processes that initiate access requests to Server Workloads, operating autonomously without direct user interaction.Learn more, Server Workload, and whether Aembit granted or denied access, together with the reason for a denial.
A denial reason such as an attestation failure tells you the Access Policy: Access Policies define, enforce, and audit access between Client and Server Workloads by cryptographically verifying workload identity and contextual factors rather than relying on static secrets.Learn more, the Trust Provider: Trust Providers validate Client Workload identities through workload attestation, verifying identity claims from the workload's runtime environment rather than relying on pre-shared secrets.Learn more, or another Access Policy component is the problem rather than your code. See Access Authorization Events for each event type, its fields, and worked failure examples.
Verify credential delivery
Section titled “Verify credential delivery”The verification steps differ by path, because each path puts the credential-handling logic in a different place. Select your integration path:
Agent Proxy intercepts your application’s requests transparently, so verify that the interception happened and that the injected credential worked.
-
Check the Agent Proxy logs for credential events, which confirm Agent Proxy intercepts your application’s requests.
Linux (systemd) sudo journalctl --namespace aembit_agent_proxy | grep -i "credential"Kubernetes # Standalone deploymentkubectl logs <agent-proxy-pod> -n <namespace> -f# Sidecar injection (Agent Proxy runs as a container in your application pod)kubectl logs <pod> -n <namespace> -c aembit-agent-proxy -fLog lines that reference GetCredentials, credential injection, or authentication confirm the interception. Check the Agent Proxy logs specifically, because the Agent Controller logs cover registration and Access Policy sync rather than credential interception.
-
Confirm your application receives a valid credential by logging the result of its normal authentication call. For example, an application that requests an OAuth token logs the intercepted request’s result:
token_response = requests.post('https://oauth-provider.com/token',data={'grant_type': 'client_credentials','client_id': 'your-app-id','client_secret': 'placeholder-client-secret', # Aembit replaces this'scope': 'api.read'})if token_response.ok:logger.info("Received access token, expires in %s seconds", token_response.json().get('expires_in'))else:logger.error("Token request failed: %s", token_response.text)A valid access token, an API response in the 200-299 range, or an established database connection confirms delivery, depending on your target service.
-
Confirm the target service accepts the credential by calling a protected resource. A response in the 200-299 range with no
401 Unauthorizedor403 Forbiddenerrors completes the verification.
The Edge SDK retrieves credentials in-process, so failures surface as errors from the SDK calls your code makes.
-
Supply a logger when you construct the client, because the SDK stays silent by default. Any object with
debug,info,warn, anderrormethods works, and the logger reveals request lifecycles, token caching, and errors.edge-client.ts import { EdgeClient, trustProviders } from "@aembit/edge-sdk";const client = new EdgeClient({baseUrl: "https://<tenantId>.aembit.io",clientId: "<your-edge-sdk-client-id>",trustProvider: trustProviders.awsMetadataService(),logger: console,}); -
Authenticate and retrieve a credential, and branch on the
kindthe SDK attaches to every error:trust_providerorauth- The identity evidence from the environment doesn’t satisfy the Trust Provider, so compare the two using the Edge API authentication contexts.credential- Aembit denied retrieval, so check the authorization events for the Access Policy denial reason.transport- The request never reached Aembit, so check network egress from your workload to your Tenant.
-
Confirm the target service accepts the credential your code attaches to the request, in the format the target expects, such as a
Bearerheader or a database password.
The SDK repository carries language-specific logging and error-handling examples.
The aembit credentials get command retrieves the credential directly, so its output and exit code tell you
whether retrieval succeeded.
-
Run the command on its own before wiring it into a script:
Terminal window aembit credentials get \--server-workload-host api.example.com \--server-workload-port 443 \--client-id <your-edge-sdk-client-id>The command prints the credential on success and an error on failure, and its exit code tells your script which happened.
-
When retrieval fails, match the error against Troubleshooting the Aembit CLI, which covers Access Policy matching, Credential Provider: Credential Providers obtain the specific access credentials—such as API keys, OAuth tokens, or temporary cloud credentials—that Client Workloads need to authenticate to Server Workloads.Learn more, and connectivity errors.
-
Confirm the target service accepts the credential your script passes it.
The Edge API makes each stage an explicit HTTP call, so the response status of each call locates the failure.
-
Authenticate by sending your environment’s identity evidence, such as an OIDC identity token or AWS instance metadata, to the
/edge/v1/authendpoint, and expect a200response with anaccessToken. A401here means the identity evidence doesn’t satisfy the Trust Provider, so check the authentication context for your environment and the Edge SDK Client ID: A structured identifier that Aembit generates when you configure a Trust Provider, encoding your region, tenant, and Trust Provider. It identifies a Trust Provider rather than an individual Client Workload.Learn more you passed. Pass the identity evidence in the request body, because setting it as anAuthorizationheader also returns401. -
Retrieve the credential from the
/edge/v1/credentialsendpoint with theaccessTokenas aBearerheader, and expect a200response with the credential data. A failure here means Aembit denied retrieval, so check the authorization events for the Access Policy denial reason. -
Confirm the target service accepts the credential your code attaches to the request.
The endpoint reference covers request and response details, and the Edge API quickstart lists common errors with solutions.
Troubleshoot common failures
Section titled “Troubleshoot common failures”The most common failures also differ by path. Select your integration path:
- Your client library reports invalid credentials - Verify Agent Proxy is running with
systemctl status aembit_agent_proxy, check its logs for interception activity, and confirm the Access Policy is active and correctly configured. - The placeholder value appears in the target service’s logs - The interception isn’t happening, so verify the
HTTP_PROXYenvironment variables for proxy-based interception and configure TLS Decrypt for HTTPS targets. - The application works locally but fails when deployed - Confirm the deployed environment doesn’t set the real secret in an environment variable, runs Agent Proxy and Agent Controller, and can reach Aembit Cloud: Aembit Cloud serves as both the central control plane and management plane, making authorization decisions, evaluating policies, coordinating credential issuance, and providing administrative interfaces for configuration.Learn more.
- Attestation fails on every call - The workload’s environment doesn’t present evidence the Trust Provider can verify, so compare the Trust Provider’s match rules against the evidence your environment provides.
- Authentication succeeds but retrieval is denied - No active Access Policy permits the Client Workload to reach the Server Workload, so check the Access Policy and the authorization events.
- Calls fail before reaching Aembit -
transporterrors point to network egress, so confirm the workload can reach your Tenant’s Edge API base URL.
Troubleshooting the Aembit CLI covers the common failures with solutions, including:
- No output when using
--credential-names TOKENcredential mismatch errors- Access Policy matching errors
- Invalid
client_iderrors - Can’t-connect-to-cloud errors
401 Unauthorized- The identity evidence is invalid or expired (CI/CD OIDC tokens expire after 1 hour), the Edge SDK Client ID is wrong, or the request passes the identity evidence as anAuthorizationheader instead of in the body.400 Bad Request- Theclientobject is missing required attestation data, or thecredentialTypeis unsupported.500 Internal Server Error- The Credential Provider configuration or the connection to the target service is the problem, so check the provider and retry after a brief delay.
The Edge API quickstart shows each error response with causes and solutions.
Related resources
Section titled “Related resources”- Server Workload troubleshooting - Common issues and solutions beyond integration testing
- Local development - Get credentials while developing on your own machine
- Integrate through Agent Proxy - The developer-side procedure, from placeholder credential to verified request