04 66 72 51 22

Office 365: "Please reconnect the Office365 account" or Azure authentication error

This page is intended for administrators whose Office 365 (Microsoft 365) backup fails because Microsoft is denying access to the account or the tenant. It explains how to restore the connection in each of the two modes available for an Office 365 medium, and how to interpret the reason returned by Microsoft. It applies to BeBackup server 7.

Symptom

The Office 365 backup does not start, or it stops shortly after starting. The report or the web interface displays one of the following messages:

Please reconnect the Office365 account … followed by the account address.

Azure refused authentication: … followed by the reason given by Microsoft. This message relates to delegated mode (Single account).

Microsoft refused the tenant token: … followed by the reason given by Microsoft, beginning with an AADSTS code. This message relates to tenant mode (Multiple accounts (tenant)).

The Microsoft token service did not return an access_token. Check the tenant ID, the application ID and the administrator consent.

On the medium's details page, the Office 365 connection status field shows Not authenticated or Tenant not configured.

Cause

An Office 365 medium operates in one of two modes. The mode is shown on the medium's details page, under Operating mode. It is set when the medium is created and cannot be changed afterwards.

  • Single account: the medium backs up a single mailbox. It uses the access granted by that mailbox's user when they signed in from the web interface. This is delegated mode.
  • Multiple accounts (tenant): the medium backs up several mailboxes within the same tenant. It uses an Azure application registered in the tenant, with permissions granted by an administrator. This is tenant mode.

In delegated mode, the access granted by the user may cease to be valid. This happens, for example, when the password changes, or when the access is revoked within the tenant. The server then displays Please reconnect the Office365 account, and the connection must be re-established.

In tenant mode, Microsoft refuses the application's token when the tenant ID or the application ID is incorrect, when the secret or the certificate is no longer valid, or when administrator consent is missing.

Checks

  1. Open the medium's details page in the web interface (Office365 medium details). Note the Operating mode and the Office 365 connection status.
  2. Read the reason following Azure refused authentication: (delegated mode) or Microsoft refused the tenant token: (tenant mode). Microsoft provides a code beginning with AADSTS. The table below lists the most common cases.
  3. In tenant mode, check the expiry date shown under Dedicated Azure application. After that date, the backup stops.
  4. Check that the BeBackup server's clock is accurate. In tenant mode with certificate authentication, a clock that is out of sync causes Microsoft to refuse the token.
Microsoft codeMeaningWhat to do
AADSTS70008The sign-in code has expired.Start the connection again.
AADSTS65001Consent has not been granted.Have the permissions approved by a tenant administrator.
AADSTS7000215 (tenant mode)The client secret is invalid.Enter a valid secret, or recreate the application.
AADSTS700027 (tenant mode)The application's certificate cannot be found.Recreate the Azure application.
AADSTS700024 (tenant mode)The token's time does not match Microsoft's time.Correct the BeBackup server's clock.

Fix in delegated mode (Single account)

  1. Open the Office 365 medium's details page.
  2. Click Sign in.
  3. In the Microsoft window, sign in with the account of the mailbox to be backed up, then accept the permissions.
  4. Check that the status shows Authenticated.

If the message Unable to open the Office365 sign-in pop-up. appears, the browser is blocking pop-up windows. Allow them for the web interface address, then try again.

Fix in tenant mode (Multiple accounts (tenant))

BeBackup can create the Azure application in your tenant for you.

  1. On the medium's details page, click Create the Azure application, or Recreate the Azure application if it already exists.
  2. Open the Microsoft page indicated, then enter the code displayed.
  3. Sign in with a global administrator account for the tenant, then approve the permissions requested.
  4. Wait for the message The application has been created and this medium's configuration saved.

If creation fails, the message Nothing has been saved on this medium: the previous configuration, if any, is intact. confirms that the former configuration has been preserved.

The Manual configuration block on the details page contains only two fields: Tenant ID and Client secret. It does not allow an application ID or a certificate to be entered. If your tenant prohibits device code authentication, or if the server has no direct access to Microsoft, and creating the application from the details page is therefore impossible, contact BeBackup support before creating the application by other means.

A single mailbox fails in tenant mode

In tenant mode, the failure of one mailbox does not stop the others from being backed up. The report states:

The mailbox "…" could not be backed up: … The other mailboxes are being backed up normally. This one will be retried at the next backup.

The backup then completes "with errors". It stops entirely in three cases: a requested stop, a refusal from Microsoft that applies to the whole tenant, or several consecutive mailbox failures. In the latter case, the message begins with the number of mailboxes and contains the error probably does not come from the mailboxes themselves. In that case, check the application's configuration as described above.

If the problem persists

Contact BeBackup support. Include the medium's name, the operating mode, the time of the failure, the full text of the message, and the AADSTS code if one is shown.

BeBackup is backup built for IT service providers

Backup and restore of workstations, servers, virtual machines and Microsoft 365, encrypted at source with a key we do not hold, on the hosting of your choice.