Share via

Authentication token expired

SeriousJ 201 Reputation points
2023-05-07T12:25:33.16+00:00

We're using API V13 of the Bing Ads API.

It was working fine and then without us touching our code, we started to get "AuthenticationTokenExpired" errors.

We checked an re-checked many times and our authentication token is created right before making a call, so it can't have expired in a few seconds. What's going on?

Below is the exception we're getting:

 [previous:Exception:private] => 
    [faultstring] => Invalid client data. Check the SOAP fault details for more information. TrackingId: 4621e7a3-5add-456f-800d-45aab387f34e.
    [faultcode] => s:Server
    [faultcodens] => 
    [faultactor] => 
    [detail] => stdClass Object
        (
            [AdApiFaultDetail] => stdClass Object
                (
                    [TrackingId] => 4621e7a3-5add-456f-800d-45aab387f34e
                    [Errors] => stdClass Object
                        (
                            [AdApiError] => stdClass Object
                                (
                                    [Code] => 109
                                    [Detail] => 
                                    [ErrorCode] => AuthenticationTokenExpired
                                    [Message] => Authentication token expired. Please renew it or obtain a new token.
                                )

                        )

                )

        )
Microsoft Advertising API
Microsoft Advertising API

A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.


Answer accepted by question author

Hel_code 85 Reputation points
2023-05-09T15:57:55.16+00:00

We were able to resolve our issue by changing the requested scope to "openid offline_access https://ads.microsoft.com/msads.manage" in the OAuth authorization request that redirects the user to https://login.live.com/oauth20_authorize.srf.

Then when requesting the access token we added the scope "https://ads.microsoft.com/msads.manage" in the request. It does require the user to create a new OAuth authorization, but seems to have resolved it on our side.

Was this answer helpful?

1 person found this answer helpful.

7 additional answers

Sort by: Most helpful
  1. Luke 5 Reputation points
    2023-05-08T11:17:02.13+00:00

    I completely re-created the app registration and that seems to have fixed the problem.

    For us we were not using the new msads.manage scope. But apart from that I changed nothing else in the re-creation process.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. CFJ 0 Reputation points
    2023-05-08T11:53:55.0833333+00:00

    Same problem for me. It started happening late in the afternoon on Friday May 5th. Zero code changes on our end. Our Refresh Token is successfully being exchanged for an Access Token, but then any requests we make using the tokens are met with "AuthenticationTokenExpired".

    For the Microsoft folks, here are a few of the most recent response tracking IDs. Please advise.

    22a1e644-0898-480d-983f-5f912189f4b9

    960a5543-d44f-427e-871e-4fc4e5d5026a

    363724e4-b9ac-44da-a21a-008218b589ad

    Was this answer helpful?

    0 comments No comments

  3. Machiel Roos 0 Reputation points
    2023-05-08T08:34:30.3633333+00:00

    Same here, started 5th of May. Token is issued correctly (also refresh-tokens are issued as usual), but it instantly invalidates with the message 'AuthenticationTokenExpired'. Is this a known issue on Microsoft Ads end?

    Was this answer helpful?

    0 comments No comments

  4. Luke 5 Reputation points
    2023-05-08T06:53:09.47+00:00

    Same issue. Started on May 5th for me.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.