Skip to content

Enabling automatic programmatic authentication for third-party APIs #19

Closed

Description

@sin4ch

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.

Activity

  1. aws-khargita commented on Jul 14, 2025

    @aws-khargita
    Member

    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.

  2. sin4ch commented on Jul 14, 2025

    @sin4ch
    Author

    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.

  3. reopened this on Jul 30, 2025
  4. self-assigned this
    on Jul 30, 2025
  5. chrisns commented on Dec 29, 2025

    @chrisns

    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 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.

  6. chrisns commented on Feb 28, 2026

    @chrisns

    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-client handles all the JWT plumbing automatically for service-to-service access:

    • Retrieves the signing secret directly from AWS Secrets Manager
    • Signs and caches JWT tokens with automatic renewal — no manual refresh needed
    • Invalidates the secret cache on 401/403 to handle secret rotation transparently
    • Typed methods for the full ISB API: read leases, accounts and templates, approve/deny leases, register accounts, paginated account listing

    It's designed for exactly the headless service-to-service (machine-to-machine) use case described here.

  7. moved this from Backlog of Feature Requests to In Development in Innovation Sandbox on AWS Roadmapon Mar 17, 2026
  8. abewub commented on Aug 27, 2026

    @abewub
    Member

    This is implemented in v1.3.0 release. Please refer to this section in the Implementation Guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions