You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enabling automatic programmatic authentication for third-party APIs #19
I am currently building an API to access the deployed sandbox API to lease, list and terminate sandbox accounts. However, I can't deploy that application to a production environment due to the fact that I have to replace the JWT token every 30 minutes from the Network tab of the Page Inspect in my browser.
I understand that this was built for browser-based access but is there any way that service-to-service authentication can be provided, rather than just client authentication, in case the use case for this won't be through the web UI but rather through APIs?
If not, can I add it myself? Will that stop the application from building properly?
Sorry if these questions sound basic. I'm not the best JavaScript/TypeScript dev.
You are right the solution was built to primarily work with the UI that is provided. The ISB team is working on providing better support for using the API heedlessly either without a UI or through some custom UI.
Providing better support for these use cases as well as a client credential flow (machine-to-machine) is in our backlog and should be included by default in the future. In the meantime you are absolutely free to attempt to implement it yourself but it may be a larger lift than it initially seems.
Thanks for the response. I'll go ahead to try to implement the IAM access. Maybe if I'm able to solve that, I could make a PR. If I'm not, then I'll just wait till the team implements it.
For those looking to integrate programmatically with ISB, our auto-approver takes a different approach - it subscribes to EventBridge events rather than calling the ISB Lambda directly:
It listens for LeaseRequested events from ISB's EventBridge and then invokes the ISB Lambda directly for approvals. This avoids the JWT authentication issue entirely since it operates at the infrastructure level.
Tip: When calling the ISB Lambda directly (bypassing API Gateway), you can provide a dummy but structurally valid JWT - ISB will accept it since the authentication/authorisation is handled at the API Gateway layer, not within the Lambda itself.
Note: This is an example implementation for our specific use case rather than a general-purpose solution, but it demonstrates EventBridge integration if that approach works for your use case.
Activity
aws-khargita commentedon Jul 14, 2025
Hi @sin4ch,
You are right the solution was built to primarily work with the UI that is provided. The ISB team is working on providing better support for using the API heedlessly either without a UI or through some custom UI.
Providing better support for these use cases as well as a client credential flow (machine-to-machine) is in our backlog and should be included by default in the future. In the meantime you are absolutely free to attempt to implement it yourself but it may be a larger lift than it initially seems.
sin4ch commentedon Jul 14, 2025
Thanks for the response. I'll go ahead to try to implement the IAM access. Maybe if I'm able to solve that, I could make a PR. If I'm not, then I'll just wait till the team implements it.
chrisns commentedon Dec 29, 2025
For those looking to integrate programmatically with ISB, our auto-approver takes a different approach - it subscribes to EventBridge events rather than calling the ISB Lambda directly:
https://github.com/co-cddo/innovation-sandbox-on-aws-approver
It listens for
LeaseRequestedevents from ISB's EventBridge and then invokes the ISB Lambda directly for approvals. This avoids the JWT authentication issue entirely since it operates at the infrastructure level.Tip: When calling the ISB Lambda directly (bypassing API Gateway), you can provide a dummy but structurally valid JWT - ISB will accept it since the authentication/authorisation is handled at the API Gateway layer, not within the Lambda itself.
Note: This is an example implementation for our specific use case rather than a general-purpose solution, but it demonstrates EventBridge integration if that approach works for your use case.
chrisns commentedon Feb 28, 2026
For anyone looking for a ready-made solution to this: we've built and open-sourced a TypeScript/Node.js client that handles exactly this use case —
https://github.com/co-cddo/innovation-sandbox-on-aws-client
@co-cddo/isb-clienthandles all the JWT plumbing automatically for service-to-service access:It's designed for exactly the headless service-to-service (machine-to-machine) use case described here.
abewub commentedon Aug 27, 2026
This is implemented in v1.3.0 release. Please refer to this section in the Implementation Guide.