Skip to content

Commit

Permalink
facebook: removed Auth-Token from header (replaced by authentication_…
Browse files Browse the repository at this point in the history
…id in the request body)
  • Loading branch information
Aadesh Patel committed Nov 14, 2019
1 parent 65b72db commit 0fc56fd
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
Expand Down Expand Up @@ -142,9 +139,6 @@
"Accept": [
"application/json"
],
"Auth-Token": [
"test-app-id|test-app-secret"
],
"Content-Type": [
"application/json;charset=utf-8"
],
Expand Down
13 changes: 1 addition & 12 deletions adapters/audienceNetwork/facebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ type FacebookAdapter struct {
URI string
nonSecureUri string
platformID string
appID string
appSecret string
}

Expand Down Expand Up @@ -75,7 +74,6 @@ func (this *FacebookAdapter) buildRequests(request *openrtb.BidRequest) ([]*adap

headers.Add("Content-Type", "application/json;charset=utf-8")
headers.Add("Accept", "application/json")
headers.Add("Auth-Token", this.appID+"|"+this.appSecret)
headers.Add("X-Fb-Pool-Routing-Token", request.User.BuyerUID)

for _, imp := range request.Imp {
Expand Down Expand Up @@ -406,7 +404,7 @@ func resolveImpType(imp *openrtb.Imp) (openrtb_ext.BidType, bool) {
return openrtb_ext.BidTypeBanner, false
}

func NewFacebookBidder(client *http.Client, platformID string, appID string, appSecret string) adapters.Bidder {
func NewFacebookBidder(client *http.Client, platformID string, appSecret string) adapters.Bidder {
if platformID == "" {
glog.Errorf("No facebook partnerID specified. Calls to the Audience Network will fail. Did you set adapters.facebook.platform_id in the app config?")
return &adapters.MisconfiguredBidder{
Expand All @@ -415,14 +413,6 @@ func NewFacebookBidder(client *http.Client, platformID string, appID string, app
}
}

if appID == "" {
glog.Errorf("No facebook app ID specified. Calls to the Audience Network will fail. Did you set adapters.facebook.app_id in the app config?")
return &adapters.MisconfiguredBidder{
Name: "audienceNetwork",
Error: errors.New("Audience Network is not configured properly on this Prebid Server deploy. If you believe this should work, contact the company hosting the service and tell them to check their configuration."),
}
}

if appSecret == "" {
glog.Errorf("No facebook app secret specified. Calls to the Audience Network will fail. Did you set adapters.facebook.app_secret in the app config?")
return &adapters.MisconfiguredBidder{
Expand All @@ -439,7 +429,6 @@ func NewFacebookBidder(client *http.Client, platformID string, appID string, app
//for AB test
nonSecureUri: "http://an.facebook.com/placementbid.ortb",
platformID: platformID,
appID: appID,
appSecret: appSecret,
}
}
2 changes: 1 addition & 1 deletion adapters/audienceNetwork/facebook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ type FacebookExt struct {
}

func TestJsonSamples(t *testing.T) {
adapterstest.RunJSONBidderTest(t, "audienceNetworktest", NewFacebookBidder(nil, "test-platform-id", "test-app-id", "test-app-secret"))
adapterstest.RunJSONBidderTest(t, "audienceNetworktest", NewFacebookBidder(nil, "test-platform-id", "test-app-secret"))
}

0 comments on commit 0fc56fd

Please sign in to comment.