Credentials and Expiry

Microsoft Entra ID: Integrations & Access Troubleshooting

Course 1 ยท Chapter 4 ยท Credentials and Expiry

"It expired" is the most common explanation for an integration that suddenly stops. But Entra has several different things that can expire, on very different timescales, and they are fixed in very different ways. A token that lasts an hour and a client secret that lasts two years are not the same kind of thing. This chapter sorts them out, with the lifetimes Microsoft documents, so you can say exactly what expired and who has to act.

The one distinction to remember
Tokens expire all the time, in minutes or hours, and are renewed automatically by software. Credentials (a client secret, a certificate, a SAML signing certificate, a provisioning credential) expire on a calendar date, and are renewed only when a person creates a replacement and puts it in the right places. When an integration stops working for everyone at once, a credential is the suspect. A token expiring normally just causes a quiet renewal.

What Can Expire

ItemUsed byLifetime (as documented)Renewed by
Authorization codeOpenID Connect sign-in (Chapter 3, step 3)About 1 minuteAutomatic: a new sign-in issues a new one
Access tokenCalling an APIA random value between 60 and 90 minutes (75 on average) by defaultAutomatic: refresh token or a new request
Refresh tokenGetting new access tokens90 days by default; 24 hours for single-page apps and for email one-time-passcode flowsReplaced at every use; if it expires or is revoked, the user must sign in again
Client secretYour system proving its identity to Entra (patterns 1 and 3)Up to 24 months (Microsoft recommends under 12)A person, who creates a new secret and updates your system
Certificate credentialThe same, with a certificate instead of a secretThe certificate's own validity (and any tenant policy limit; see below)A person, or automation
Federated credentialA workload proving identity through another trusted identity providerNo secret to expireNot applicable
SAML signing certificateEntra signing assertions to your system (pattern 2)By default 3 years; the date can be chosen when creating oneA person in the client's tenant, then your system must be updated
Provisioning credentialEntra connecting to your SCIM endpoint (pattern 4)Set by your system, so whatever you choseYou issue it; the client's administrator enters it

The sources are Microsoft Learn pages on access tokens, refresh tokens, authorization code flow, adding app credentials and managing federation certificates. Check them before quoting a number to a client; Microsoft does change defaults.

Client Secrets

A client secret is described by Microsoft as sometimes called an "application password": a string your system sends to prove who it is. It is created in the application's registration, under App registrations > (your app) > Certificates & secrets > Client secrets > New client secret, by choosing a description and an expiry (or a custom lifetime).

  • Lifetime: limited to two years (24 months) or less. A custom lifetime longer than 24 months can't be set. Microsoft recommends under 12 months.
  • The value is shown only once. Microsoft says the secret Value is never displayed again after you leave the creation page. If nobody copied it, it cannot be recovered; a new secret has to be created.
  • Microsoft discourages them in production. The documentation says client secrets are less secure than certificates or federated credentials, and recommends a certificate before moving to production.
What this means when a client says "we need a new secret"
Creating a new secret does not change anything in your system by itself, and an old secret that is still in your configuration keeps working until its own expiry date. Replacing a secret is two jobs: create the new one (in the client's tenant, or yours, depending on the arrangement from Chapter 2) and enter its value in your system. Do them in that order, keep the old one until the new one is proved working, then remove the old one (Chapter 8).

Certificates on an App Registration

A certificate is the credential Microsoft recommends. Per the documentation, a public certificate is uploaded under Certificates & secrets > Certificates > Upload certificate, accepted as .cer, .pem or .crt, and the certificate's thumbprint is what the client application uses to refer to it. Your system holds the matching private key and signs a short assertion with it for each token request (Chapter 3). Two points for support:

  • The certificate has its own validity dates. When they lapse, token requests fail in the same way an expired secret does.
  • Whoever manages the private key manages the risk. For production Microsoft recommends a certificate from a well-known certificate authority, managed through a service like Azure Key Vault. See the HTTPS/TLS Fundamentals course for how certificates work in general.

SAML Signing Certificates

When SAML single sign-on is set up on an enterprise application, Entra generates a self-signed signing certificate that is, by default, valid for three years. This is the certificate your system uses to check every assertion (Chapter 3). A few rules from Microsoft's certificate tutorial matter in practice:

  • The expiry date can't be edited after saving. To get a different date you create a new certificate (the portal offers any date between today and three years away), save it, give it to the application, then make it active. New certificates start as Inactive; Make certificate active promotes it and demotes the old one.
  • Entra emails before expiry: 60, 30 and 7 days before the SAML certificate expires. By default the only recipient is the administrator who added the application; up to five addresses can be listed, and a distribution list is suggested if more people need it. The sender is azure-noreply@microsoft.com, which is worth allow-listing. If the addresses were set through Graph or PowerShell, Microsoft advises opening the SAML page in the portal to confirm notifications are registered.
  • Renewal without downtime: create the new certificate with a date that overlaps the old one, give it to the application, then activate it. If the application accepts only one certificate at a time, choose a short maintenance window.
  • Role needed: Privileged Role Administrator, Cloud Application Administrator or Application Administrator.
The two-sided trap
Microsoft warns that if the certificate is renewed in Entra but not updated in the application, authentication on the application may fail. It also notes that if both an expired certificate and an inactive valid certificate exist, Entra automatically uses the valid one, and users might then experience an outage if the application hasn't been updated. Conversely, an application that doesn't check certificate expiry will keep accepting an expired certificate that still matches. Two things follow: renewing in the portal alone is never enough, and an integration that "didn't break" on the expiry date isn't necessarily healthy.
Metadata makes rollover easier
Microsoft's guidance for software vendors recommends reading the application's federation metadata URL regularly (at least every 24 hours), adding any newly published certificate as a secondary one, and switching to it when the customer activates it. If your product can do that, a certificate renewal in the client's tenant stops being a two-person emergency. If it can't, ask whether that is something your team could add: it removes the "both ends must change together" problem for SAML.

Tokens and Refresh Tokens

Access tokens expire after roughly an hour and the software quietly gets another, so a token expiring is not by itself a fault. Refresh tokens are different, because their end does surface to people. Microsoft documents their default lifetime as 90 days (24 hours for single-page apps and email one-time-passcode flows), and says they can be revoked by the service at any time before then. Your application is expected to handle revocation by sending the user to an interactive sign-in again.

Revocations that Microsoft lists include:

  • the user revokes their own refresh tokens, or an administrator revokes all of a user's tokens (everything is revoked);
  • an administrator resets the user's password in the Microsoft Entra admin center or the Microsoft 365 admin center (revokes tokens issued to confidential clients as well as most others);
  • a password change by the user or a self-service reset, which revokes some kinds of token but, per Microsoft's table, leaves a confidential client's token alive; and
  • a password simply expiring, which doesn't revoke tokens.

For support, this explains a particular pattern: an integration that acts for one user in the background (for example, reading their calendar) works for weeks and then stops after that person's password is reset by an administrator or their tokens are revoked. That is not an expired credential and renewing a secret will not fix it; the user has to authorise the integration again.

Rules That Shape These Lifetimes

A tenant can restrict how applications are configured, using app management policies, which Microsoft describes as controls over how app owners and administrators configure applications and service principals. They are found at Entra ID > Enterprise apps > Application policies and configured by a Security Administrator together with an Application or Cloud Application Administrator (or by a Global Administrator). Among the restrictions Microsoft lists:

Restriction (portal name)EffectWhy a support engineer cares
Restrict max password lifetimeCaps how long a client secret may lastThe client may be unable to create the lifetime you asked for; secrets may be short, so renewals are frequent
Restrict max certificate lifetimeCaps how long a certificate credential may lastLikewise for certificates (Microsoft's own example uses 180 days)
Block password additionPrevents any new secret being added to applicationsA client may be unable to renew a secret at all and must move to a certificate or federated credential
Block multitenant applicationsPrevents apps being created or promoted as multitenantCan change which of the arrangements in Chapter 2 is even possible

So "the client can't create a new secret" is not necessarily a permissions issue: a tenant policy may be forbidding it. Ask the administrator whether application policies are in force before assuming anything else.

Finding Out What Expires, and When

Chapter 5 walks through the portal in detail, but the places to look follow directly from this chapter:

You want to seeLook at
Client secrets and certificatesEntra ID > App registrations > (the app) > Certificates & secrets, which lists each credential with its expiry
SAML signing certificateEntra ID > Enterprise apps > All applications > (the app) > Single sign-on > SAML Certificates (edit icon): the status, expiry date and thumbprint of each certificate
Credentials expiring soon, tenant-wideEntra ID > Overview > Recommendations > Renew expiring application credentials

That recommendation, per Microsoft, appears when an application registration has a credential expiring within the next 30 days. The roles that can view it include Reports Reader, Security Reader and Global Reader. Microsoft's documented fix is the sequence you will use in Chapter 8: add a new credential, update the service to use it, check in the sign-in logs that the new credential is the one being used, then remove the old one. Microsoft's own sample of that recommendation lists a required licence of Microsoft Entra Workload ID, so confirm what the client has before telling them it will be there.

Symptoms: Which Kind of Expiry Is It?

What the client reportsMost likelyFirst check
"Everyone at one client stopped being able to sign in, from one moment"An expired client secret or certificate (OIDC), or a changed or expired SAML signing certificateExpiry dates on the registration or the SAML certificate (Chapter 5); the sign-in logs for the error (Chapter 7)
"A nightly job stopped, nobody is signed in"An expired secret or certificate used for API accessCredential expiry; a 'credentials invalid' error at the token request
"New staff haven't appeared in our system"The provisioning credential that you issued has expired or changed, or the job is quarantinedThe provisioning status and logs; your system's credential
"It worked after we renewed the certificate on Monday, but now everyone fails"Entra's certificate was renewed but your system wasn't updated (or the reverse)The SAML certificate status and thumbprint on both sides
"One person's background sync stopped after their password was reset"Revoked refresh token for that userAsk the user to authorise the integration again; this is not a credential renewal
"Users sign in fine but our system says 'invalid token'"Not an expiry: validation (audience, issuer, signing keys) on your sideChapter 3's step 6
What you can tell the client
"Your sign-in to us goes through a connection that uses a credential in your Microsoft tenant. Those credentials have an expiry date, and when one expires, everyone is refused at the same time even though their accounts are fine. We need your Entra administrator to check the expiry date and create a replacement, and then we'll update our side to match." It is accurate, it doesn't blame anyone, and it tells them who has to do what.

Hands-On Exercises

All three use fictional data. "Today" in the exercises is 1 October 2026.

Exercise 1

For each of the following, say whether it is a credential or a token, how long it typically lasts, and who or what renews it: (a) a client secret; (b) an access token; (c) a SAML signing certificate; (d) a refresh token for a normal web app; (e) an authorization code; (f) a certificate credential on an app registration; (g) a provisioning credential issued by your system.

๐Ÿ“„ View solution
Exercise 2

Audit this fictional credential register as at 1 October 2026. Work out what has already expired, what must be renewed within 30 days, which SAML certificate notification emails have already been sent, and which entry cannot be right.

#ItemTypeCreatedExpires
1Acme sign-in (Fabrikam tenant)Client secret2025-01-152026-10-20
2Acme SAML SSO (Contoso tenant)SAML signing certificate2023-11-252026-11-25
3Directory sync job (Fabrikam tenant)Client secret2024-09-282026-09-28
4User provisioning (Contoso tenant)SCIM credential we issued2026-03-012027-03-01
5Reporting API job (Contoso tenant)Certificate credential2025-02-142027-02-14
6Test app (Fabrikam tenant)Client secret2026-09-302028-12-01
๐Ÿ“„ View solution
Exercise 3

Three fictional reports. For each, say whether the likely cause is an expired credential, a changed or mismatched certificate, or a revoked token; who must act; and what you'd check first. (a) "Fabrikam's nightly sync failed at 00:01 on 28 September and has failed every night since." (b) "On Monday Contoso's administrator renewed the SAML certificate. Since Monday afternoon nobody at Contoso can sign in." (c) "Our integration reads Dana's calendar. It stopped on Tuesday, the day IT reset Dana's password. Nobody else is affected."

๐Ÿ“„ View solution

Chapter 4 Quick Reference

  • Tokens expire in minutes or hours and renew automatically; credentials expire on a calendar date and need a person
  • Authorization code about 1 minute; access token random 60 to 90 minutes (75 average); refresh token 90 days (24 hours for single-page apps and email OTP flows)
  • Client secret: 24 months at most (Microsoft recommends under 12); the value is shown once; discouraged in production
  • Certificate credential: recommended over secrets; upload .cer/.pem/.crt; refer to it by thumbprint
  • SAML signing certificate: default 3 years; the date can't be edited after saving, so create a new certificate; new ones start Inactive until you "Make certificate active"
  • SAML expiry emails: 60, 30 and 7 days before; default recipient is the admin who added the app; up to five addresses
  • Renewing in Entra alone is never enough: the application must be updated too; an app that doesn't check expiry may mask the problem
  • Refresh tokens can be revoked early (admin password reset, user or admin revoking tokens); that needs a new user sign-in, not a new secret
  • App management policies can cap lifetimes or block new secrets entirely: Entra ID > Enterprise apps > Application policies
  • Where to look: Certificates & secrets (registration), SAML Certificates (enterprise app), Recommendations (credentials expiring within 30 days)
  • Replace in order: create new, update your system, prove it works, then remove the old