Skip to content

Est. 2011ยทMicrosoft Partner ID 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix AADSTS7000215

AADSTS7000215 and AADSTS700016: bad client secret or missing app registration

10 min read Updated October 5, 2026 Microsoft 365 & Entra ID

Fix it now

Entra ID either rejected the credential your application presented or could not find the application at all. The usual cause is that the Secret ID was copied into the configuration instead of the secret Value, or the secret has passed the expiry date it was given when it was created.

  1. In the Microsoft Entra admin center, open App registrations, select your application, then Certificates & secrets. Read the Expires column against today’s date.
  2. Create a new client secret and copy the Value column before you leave the page. The Secret ID next to it is an object identifier, not a credential, and pasting it is the single most common cause of this failure.
  3. Paste the value into the client configuration with no leading or trailing whitespace and no line break added by an editor or a pipeline variable.
  4. On the application’s Overview page, check the Application (client) ID and Directory (tenant) ID against what the client actually sends. A mismatch there produces AADSTS700016 or AADSTS700011 before the credential is examined at all.
  5. If the error mentions the reply address, add the exact redirect URI the client uses – scheme, host, port and path all match literally – under Authentication.
  6. Retry, then plan the replacement: Microsoft recommends a certificate rather than a client secret before an application goes to production.

Creating a new secret does not invalidate the old one. Deleting one does, immediately, for every client still using it – so deploy and prove the replacement first.

If the application gets a token and completes a real call, you are done. If not, the next section explains which of the three values Entra ID checks first, and why the codes arrive in the order they do.

Why it happens

A confidential client proves it is itself with something only it holds. Three values have to line up on every request: the tenant it authenticates against, the application identifier, and the credential. Entra ID checks them in that order, which is why the codes come in a sequence rather than at random. A wrong tenant or application identifier produces a not-found error before the credential is ever looked at.

Microsoft documents AADSTS700016 as the application not being found in the directory or tenant, which can happen where an administrator has not installed it, and AADSTS700011 as no application with that identifier being present in the directory called. Neither says anything about your secret, so replacing the secret in response to either wastes an afternoon.

AADSTS7000215 is the code most readers arrive with, and it is worth being straight about it: it is not in Microsoft’s AADSTS error code reference. The reference does publish AADSTS70002 – the specified client_secret does not match the expected value for this client. Work 7000215 as that class of failure, but do not expect a vendor page to define the number. Secrets are stored as hashes, so a lost one cannot be retrieved, only replaced, and each carries an expiry chosen at creation that nothing warns you about.

The Secret ID was used instead of the secret Value

You have this one if The credential in your configuration is a tidy identifier-shaped string rather than a long opaque one, and it has never worked even once.

  1. Create a new secret from Certificates & secrets on the registration.
  2. Copy the Value column immediately, before navigating away.
  3. Replace the credential in the client configuration and restart the application.

The secret has expired

You have this one if The application worked until a particular day with no change deployed, and Certificates & secrets shows the secret past its end date.

  1. Create a replacement secret with an expiry you have chosen rather than accepted by default.
  2. Deploy the new value, confirm the application works, then remove the old entry.
  3. Query the registration’s credential end dates on a schedule and alert on them, because nothing does this for you.

Microsoft recommends a certificate instead of a client secret before moving an application to production, and points to Azure Key Vault for managing certificate access and lifetime.

The secret was altered on its way to the application

You have this one if The same value works when you test locally and fails when deployed by a pipeline or written into a configuration file.

  1. Check for trailing whitespace, a newline or a line-wrapped value in the configuration store.
  2. Check whether the value passed through URL encoding or shell escaping on the way in.
  3. Read it from a secret store at runtime rather than embedding it in a file.

The application does not exist in the tenant being called

You have this one if AADSTS700016 or AADSTS700011, and the application identifier is correct for a different directory.

  1. Confirm which tenant the authority in your configuration points at.
  2. For a multi-tenant application, have an administrator in the target tenant grant consent once; that is what creates the service principal there.

The application or its service principal cannot be used for sign-in

You have this one if AADSTS70001 or AADSTS7000112, with everything else configured correctly and unchanged.

  1. AADSTS70001 is documented as the application being disabled. Open the enterprise application entry and confirm it is enabled for sign-in.
  2. Check whether the registration was deleted; it can be restored from the deleted applications list for a limited period.

AADSTS7000112 is not in Microsoft’s error reference. Diagnose it as the same class as AADSTS70001 – look at the registration and its service principal, not at the secret.

Full reference

Narrowing it down by symptom

What you see Where to look first
Worked for months, failed on a specific date The secret reached its expiry
Only one environment fails A different registration, tenant or secret in that environment
Fails on the first run after a deployment The secret was truncated, quoted or re-encoded by the pipeline
The error names the redirect or reply address The URI on the request is not on the registration’s list
Works in your tenant, fails in a customer’s No service principal for the application exists in that tenant
The value you pasted looks like a plain identifier The Secret ID was copied instead of the secret Value

Which code lands at which stage

Reading the codes as a pipeline saves most of the diagnosis. Entra ID resolves the tenant, then the application, then the credential, then the redirect. A failure at one stage means everything before it was fine.

Stage Code you get What it rules out
Application lookup in the tenant AADSTS700016, AADSTS700011 Nothing about the credential has been checked yet
Application usable for sign-in AADSTS70001 The application was found; it cannot be used
Credential validation AADSTS7000215, and the documented AADSTS70002 The tenant and application identifier are both correct
Redirect handling AADSTS50011 The credential was accepted; only the reply address is wrong

Reply address matching

AADSTS50011 is documented as the reply address being missing, misconfigured, or not matching the reply addresses configured for the app. Matching is literal. https://app.contoso.com/signin-oidc and https://app.contoso.com/signin-oidc/ are two different values, and so are the same path on ports 443 and 5001. Register every environment’s URI explicitly rather than trying to make one entry cover several.

Certificates instead of secrets

  • Microsoft recommends using a certificate rather than a client secret before an application moves to production, and describes certificates as the more secure credential type.
  • A certificate can be rotated with an overlap, so there is no moment where the old credential has been removed and the new one has not arrived.
  • For production, Microsoft’s guidance is a certificate from a well-known certificate authority with Azure Key Vault managing access and lifetime; self-signed certificates are for testing.
  • A registration can hold more than one credential at a time, which is what makes an overlapping rotation possible at all.

When the credential is definitely right

  • Confirm the client is sending the tenant you think it is. A common configuration mistake is an authority of common where a specific tenant identifier is required.
  • Check whether the application is single-tenant. A single-tenant registration is only ever present in its own directory, whatever consent a customer has granted elsewhere.
  • Confirm the flow matches the registration. A public client presenting a secret is a different failure from a wrong secret.
  • Look at the service principal separately from the registration. They are two objects, and disabling one does not look like disabling the other.
  • Check the sign-in logs for the service principal rather than the user sign-in view, because application-only sign-ins are recorded separately.

Every code this article covers

Code What it points at Source
AADSTS7000215 Returned when the credential the client presented was not accepted for this application. Microsoft’s AADSTS reference does not publish an entry for this number; the reference’s nearest documented code is AADSTS70002, the specified client_secret does not match the expected value for this client not published by the vendor
AADSTS700016 The application was not found in the directory or tenant; this can happen where an administrator has not installed it Microsoft Learn
AADSTS700011 No application with that identifier was found in the directory being called Microsoft Learn
AADSTS50011 The reply address is missing, misconfigured, or does not match the reply addresses configured for the application Microsoft Learn
AADSTS7000112 Not published in Microsoft’s AADSTS reference. Seen where the application or its service principal cannot be used for the sign-in; check the registration and service principal rather than the credential not published by the vendor
AADSTS70001 The application is disabled Microsoft Learn

Confirm the fix worked

  1. The application obtains a token and completes a real call, not just a token request.
  2. The service principal sign-in records in Entra ID show a success for the application at that time.
  3. The new secret’s expiry is recorded somewhere a person will see it, and the old credential has been removed.
  4. A second run after a restart succeeds, proving the value was persisted rather than held in memory from your test.

Questions people ask about this

Does any of this cost money?

No. Application registrations, service principals and client secrets are directory objects, not licensed features. They consume no user seat and nothing here needs a paid plan.

Why can I not just look up the existing secret?

Secrets are stored as hashes. There is no screen, cmdlet or support call that returns a secret value after the page that created it has closed. The only route is to create a new one.

Should I use a certificate instead?

For anything unattended, yes. Microsoft recommends a certificate over a client secret before an application goes to production, because it can be rotated with an overlap and is harder to leak out of a log or a configuration file.

How do I get warned before a secret expires?

Nothing warns you by default. Query the application registrations through Microsoft Graph on a schedule, read the credential end dates and raise an alert well before them.

Can two applications share one secret?

No. A secret is stored against a single registration and is only valid for that application identifier. That is also what makes revocation possible without collateral damage.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix 403 FORBIDDEN and Access Denied in SharePoint Online and OneDrive Free Fix Error 80090016 in Teams and Outlook: the TPM keyset does not exist License Error Authorization_RequestDenied: the admin centre refuses your change License Error Intune 0x8018002b and 0x80180014: MDM scope, UPN suffix and platform settings block enrolment
โ† Back to Knowledge Base