CAD integration sessions terminate unexpectedly due to expired authentication tokens during large file transfers

Our CAD integration sessions are terminating mid-transfer when engineers upload large assembly files (500MB+) from SolidWorks to Agile 9.3.5. The session appears to authenticate successfully initially, but fails after 15-20 minutes with an authentication error.

Error from the CAD connector logs:


Session token expired at 2025-04-22 09:47:32
Authentication failed: Invalid token
File transfer aborted: ASM-2847.SLDASM

The token timeout configuration seems too short for large file handling, and there’s no session persistence mechanism to maintain the connection during lengthy transfers. This is causing significant engineering delays as designers have to restart uploads multiple times for complex assemblies.

Looking for guidance on token timeout configuration and session persistence strategies for large CAD file transfers.

I’ve dealt with this exact issue. The problem isn’t just token timeout - it’s that the CAD connector doesn’t implement proper session persistence during file transfers. When transferring large files, the connector should maintain an active session by sending periodic keepalive requests to the Agile server. Without keepalives, the session is considered idle and the token expires even if data is actively transferring. You need to enable session keepalive in your CAD connector configuration and set the keepalive interval to something like 5 minutes. This way, the session remains active throughout the entire transfer process regardless of file size.

For large file handling specifically, consider implementing chunked uploads with token renewal between chunks. This approach breaks the 500MB file into smaller segments (50MB each), uploads each chunk separately, and refreshes the authentication token between chunks. This prevents timeout issues and provides better error recovery - if a chunk fails, you only need to retry that specific chunk rather than the entire file.

I’ll provide a complete solution addressing all three focus areas: token timeout configuration, session persistence, and large file handling.

Token Timeout Configuration:

The 20-minute default timeout is insufficient for large CAD file transfers. However, rather than simply increasing the timeout globally (which creates security risks), implement a differentiated timeout strategy. In your agile.properties:


auth.token.timeout.default=1200000
auth.token.timeout.cad=7200000
auth.token.refresh.enabled=true
auth.token.refresh.threshold=300000

This sets CAD-specific tokens to 2 hours while maintaining 20-minute defaults for other operations. The refresh threshold triggers automatic token renewal 5 minutes before expiration.

Session Persistence:

Implement active session maintenance in your CAD connector configuration. Edit the connector’s config.xml to enable keepalive:

<session-config>
  <keepalive-enabled>true</keepalive-enabled>
  <keepalive-interval>180000</keepalive-interval>
  <max-idle-time>3600000</max-idle-time>
</session-config>

The 3-minute keepalive interval ensures the Agile server recognizes the session as active during file transfers. The connector will send lightweight ping requests that don’t interfere with the upload but maintain session validity.

Additionally, implement token refresh logic in your custom CAD integration code:

if (tokenExpiryTime - currentTime < 300000) {
    newToken = authService.refreshToken(currentToken);
    connector.updateSessionToken(newToken);
}

Large File Handling:

For 500MB+ assemblies, implement chunked upload with progress tracking. This provides three key benefits: prevents timeout issues, enables resume capability, and improves error recovery.

Configure chunked upload in your CAD connector:


cad.upload.chunk.size=52428800
cad.upload.chunk.retry.enabled=true
cad.upload.chunk.retry.attempts=3

This breaks files into 50MB chunks. Each chunk uploads independently with its own retry logic. Between chunks, the connector refreshes the authentication token if needed.

Implementation Steps:

  1. Update your Agile authentication properties to enable CAD-specific token timeouts and refresh capabilities.

  2. Upgrade your SolidWorks connector to version 9.3.5.4 or later, which includes native token refresh support.

  3. Configure session keepalive in the connector’s XML configuration file.

  4. Enable chunked uploads for files exceeding 100MB.

  5. Implement monitoring to track upload completion rates and token refresh frequency.

Testing Protocol:

Test with progressively larger files: 100MB, 250MB, 500MB, and 1GB assemblies. Monitor the connector logs to verify:

  • Token refresh occurs automatically before expiration
  • Keepalive requests maintain session throughout transfer
  • Chunked uploads complete successfully without interruption

Additional Considerations:

For extremely large assemblies (1GB+), consider implementing server-side assembly optimization. Configure Agile to generate lightweight representations during upload, reducing the amount of data transferred initially. Full geometry can be uploaded asynchronously after the initial check-in completes.

Also enable upload progress tracking in the SolidWorks interface so engineers can monitor transfer status and estimated completion time. This reduces frustration and unnecessary upload restarts.

With these configurations, your large CAD file transfers should complete reliably without authentication failures, even for assemblies exceeding 1GB in size.

Be careful with extending token timeouts too much - it creates security risks. Instead of a blanket timeout increase, consider implementing token refresh logic in your CAD connector. The connector should request a new token before the current one expires, maintaining the session without compromising security. Most modern connectors support OAuth refresh tokens for this exact scenario.