prebid-server-java icon indicating copy to clipboard operation
prebid-server-java copied to clipboard

AudienceNetwork (S2S): add missing ext.security_app_id in OpenRTB requests to fix production auth failures

Open PeakLee opened this issue 3 months ago • 7 comments

In short: AudienceNetwork (S2S): include ext.security_app_id in OpenRTB requests. Fixes a production-only 400 ("Error validating authentication token") when test=0, while test=1 works. Adds field wiring in AudienceNetworkExt and passes it through AudienceNetworkBidder. Verified end-to-end with Meta Audience Network engineers.

Summary

This PR fixes a production-only failure in the Meta Audience Network (AN) S2S bidding integration within Prebid Server Java. In production (test=0), AN requires ext.security_app_id alongside ext.authentication_id for request authentication. The field was not present in outgoing requests, leading to 400 responses (x-fb-an-errors: Error validating authentication token). Adding ext.security_app_id resolves the issue. Test mode (test=1) remained unaffected, which masked the missing field during integration testing.

Problem Statement # Observed: • test=1 requests succeed end-to-end. • test=0 requests fail with HTTP 400, headers include x-fb-an-errors=Error validating authentication token, often with empty body and standard Meta edge headers. # Impact: Audience Network bidding seat is effectively disabled in production traffic, reducing competition and potential yield.

PeakLee avatar Sep 19 '25 08:09 PeakLee

@SerhiiNahornyi help to check it

PeakLee avatar Sep 19 '25 09:09 PeakLee

@PeakLee pls fix checkstyle

Error:  /home/runner/work/prebid-server-java/prebid-server-java/src/main/java/org/prebid/server/bidder/audiencenetwork/AudienceNetworkBidder.java:121: Line is longer than 120 characters (found 123). [LineLength]
Error:  /home/runner/work/prebid-server-java/prebid-server-java/src/main/java/org/prebid/server/bidder/audiencenetwork/proto/AudienceNetworkExt.java:6: Leave empty row after class/interface/enum definition! [RegexpMultiline]

osulzhenko avatar Sep 19 '25 16:09 osulzhenko

@PeakLee pls fix checkstyle

Error:  /home/runner/work/prebid-server-java/prebid-server-java/src/main/java/org/prebid/server/bidder/audiencenetwork/AudienceNetworkBidder.java:121: Line is longer than 120 characters (found 123). [LineLength]
Error:  /home/runner/work/prebid-server-java/prebid-server-java/src/main/java/org/prebid/server/bidder/audiencenetwork/proto/AudienceNetworkExt.java:6: Leave empty row after class/interface/enum definition! [RegexpMultiline]

@osulzhenko please check it again, just fixed the checkstyle issue and import missed "JsonProperty" annotation

PeakLee avatar Sep 20 '25 08:09 PeakLee

@PeakLee it still has invalid code in tests. Please take a look when you have time

Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/prebid-server-java/prebid-server-java/src/test/java/org/prebid/server/bidder/audiencenetwork/AudienceNetworkBidderTest.java:[484,43] method of in class org.prebid.server.bidder.audiencenetwork.proto.AudienceNetworkExt cannot be applied to given types;
  required: java.lang.String,java.lang.String,java.lang.String
  found:    java.lang.String,java.lang.String
  reason: actual and formal argument lists differ in length

osulzhenko avatar Sep 22 '25 07:09 osulzhenko

really sorry, forget the testcase updated, but i hava just fixed the issue, please check it again @osulzhenko , really appreciated !

@PeakLee it still has invalid code in tests. Please take a look when you have time

Error:  COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
Error:  /home/runner/work/prebid-server-java/prebid-server-java/src/test/java/org/prebid/server/bidder/audiencenetwork/AudienceNetworkBidderTest.java:[484,43] method of in class org.prebid.server.bidder.audiencenetwork.proto.AudienceNetworkExt cannot be applied to given types;
  required: java.lang.String,java.lang.String,java.lang.String
  found:    java.lang.String,java.lang.String
  reason: actual and formal argument lists differ in length

PeakLee avatar Sep 22 '25 07:09 PeakLee

@AntoxaAntoxic please help to check this merge request, thanks a lot

PeakLee avatar Sep 25 '25 06:09 PeakLee

@PeakLee any updates on this one?

osulzhenko avatar Oct 23 '25 15:10 osulzhenko