-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
// If the validation URL says unauthorized, the callback
// URL to re-authenticate should be returned.
srv.Config.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusUnauthorized)
})
res, err := agentClient.ExternalAuth(ctx, agentsdk.ExternalAuthRequest{
Match: "github.com/asd/asd",
})
require.NoError(t, err) <-- here
require.NotEmpty(t, res.URL)
Seen here: https://github.com/coder/coder/actions/runs/16619855254/job/47021646753
t.go:106: 2025-07-30 10:26:39.319 [warn] coderd: GET host=localhost:45915 path=/api/v2/workspaceagents/me/external-auth proto=HTTP/1.1 remote_addr=127.0.0.1 start="2025-07-30T10:26:39.074728355Z" requestor_id=b2fb915d-5244-411b-a22c-4f71f822bdaa requestor_name=testuser requestor_email=testuser@coder.com took=244.858143ms status_code=500 latency_ms=244 request_id=3160f010-4057-4aa6-935b-2656df15e747 ...
response_body= {
"message": "Failed to refresh external auth token.",
"detail": "validate external auth token: Get \"[http://127.0.0.1:38511\](http://127.0.0.1:38511/)": net/http: HTTP/1.x transport connection broken: http: CloseIdleConnections called"
}
externalauth_test.go:582:
Error Trace: /home/runner/work/coder/coder/coderd/externalauth_test.go:582
Error: Received unexpected error:
GET http://localhost:45915/api/v2/workspaceagents/me/external-auth?id=&match=github.com%2Fasd%2Fasd: unexpected status code 500: Failed to refresh external auth token.
Error: validate external auth token: Get "http://127.0.0.1:38511/": net/http: HTTP/1.x transport connection broken: http: CloseIdleConnections called
Test: TestExternalAuthCallback/ValidateURL