Skip to content

Commit 28276d0

Browse files
jmesnilclaude
andcommitted
fix: Include Authorization header in push notification webhook requests
When PushNotificationConfig includes authentication info, the agent must include the Authorization header in webhook requests per A2A spec section 4.3.3 (PUSH-DELIVER-001). The header is formatted as "{scheme} {credentials}" from the AuthenticationInfo record. This fixes a2aproject#810 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 66fefdb commit 28276d0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎server-common/src/main/java/org/a2aproject/sdk/server/tasks/BasePushNotificationSender.java‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import static org.a2aproject.sdk.client.http.A2AHttpClient.CONTENT_TYPE;
55
import static org.a2aproject.sdk.common.A2AHeaders.X_A2A_NOTIFICATION_TOKEN;
66

7-
import org.a2aproject.sdk.spec.TaskPushNotificationConfig;
7+
import org.a2aproject.sdk.spec.*;
88
import jakarta.annotation.Nullable;
99
import jakarta.enterprise.context.ApplicationScoped;
1010
import jakarta.inject.Inject;
@@ -19,13 +19,6 @@
1919
import org.a2aproject.sdk.client.http.A2AHttpClient;
2020
import org.a2aproject.sdk.client.http.A2AHttpClientFactory;
2121
import org.a2aproject.sdk.jsonrpc.common.json.JsonUtil;
22-
import org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsParams;
23-
import org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsResult;
24-
import org.a2aproject.sdk.spec.Message;
25-
import org.a2aproject.sdk.spec.StreamingEventKind;
26-
import org.a2aproject.sdk.spec.Task;
27-
import org.a2aproject.sdk.spec.TaskArtifactUpdateEvent;
28-
import org.a2aproject.sdk.spec.TaskStatusUpdateEvent;
2922
import org.slf4j.Logger;
3023
import org.slf4j.LoggerFactory;
3124

@@ -135,6 +128,10 @@ private boolean dispatchNotification(StreamingEventKind event, TaskPushNotificat
135128
if (token != null && !token.isBlank()) {
136129
postBuilder.addHeader(X_A2A_NOTIFICATION_TOKEN, token);
137130
}
131+
if (pushInfo.authentication() != null && pushInfo.authentication().credentials() != null) {
132+
postBuilder.addHeader("Authorization",
133+
pushInfo.authentication().scheme() + " " + pushInfo.authentication().credentials());
134+
}
138135

139136
String body;
140137
try {

0 commit comments

Comments
 (0)