String baseUrl = System.getenv("TOMO_IDV_BASE_URL");
String clientId = System.getenv("TOMO_CLIENT_ID");
String secretKey = System.getenv("TOMO_SECRET_KEY");

if (baseUrl == null || clientId == null || secretKey == null) {
  throw new IllegalStateException("Set the three TOMO environment variables.");
}

String tokenEndpoint = baseUrl.replaceAll("/+$", "") + "/v1/oauth2/token";
String clientAssertion = ClientAssertion.createClientAssertion(
    clientId,
    secretKey,
    tokenEndpoint
);

// Send clientAssertion as client_assertion in the token request.
// Keep it on your backend; do not log it.
