Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BingAds API does not work when using different tenant #283

Open
SgtMarmite opened this issue May 22, 2024 · 0 comments
Open

BingAds API does not work when using different tenant #283

SgtMarmite opened this issue May 22, 2024 · 0 comments

Comments

@SgtMarmite
Copy link

Hello,

We have a component (application) for extracting BingAds reports for our platform's users. We have been using bingads SDK for some time and we've had no issues for over a year. We use a separate component for OAuth and in the component itself we use OAuthWithAuthorizationCode for bingads client Authorization. Some time ago one of our clients also wanted to use this component. The only difference is that this client is not using the app registered in our tenant, but the app is registered is their own.
This means that we are using their client id and client secret for OAuth and the component, and our developer token and their tenant_id in the component for following requests.

While the OAuth works fine, as they are able to Authorize the component and we get a new token, any following request to the API ends with an error.

This is one of the errors we have received 12 days ago:

SOAP Fault Detail: 
(detail) {
    AdApiFaultDetail = 
    (AdApiFaultDetail) {
        TrackingId = "258af894-e2ec-44ee-bc93-f6c11c2dded7"
        Errors = 
        (Errors) {
            AdApiError = 
            (AdApiError) {
                Code = "105"
                Detail = None
                ErrorCode = "InvalidCredentials"
                Message = "Authentication failed. Either supplied credentials are invalid or the account is inactive"
            }
        }
    }
}

Our code is available publicly, and the Authorization class can be seen here.
Could anyone please check if we are using that class correctly in case that tenant_id is set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant