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.
What Can Expire
| Item | Used by | Lifetime (as documented) | Renewed by |
|---|---|---|---|
| Authorization code | OpenID Connect sign-in (Chapter 3, step 3) | About 1 minute | Automatic: a new sign-in issues a new one |
| Access token | Calling an API | A random value between 60 and 90 minutes (75 on average) by default | Automatic: refresh token or a new request |
| Refresh token | Getting new access tokens | 90 days by default; 24 hours for single-page apps and for email one-time-passcode flows | Replaced at every use; if it expires or is revoked, the user must sign in again |
| Client secret | Your 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 credential | The same, with a certificate instead of a secret | The certificate's own validity (and any tenant policy limit; see below) | A person, or automation |
| Federated credential | A workload proving identity through another trusted identity provider | No secret to expire | Not applicable |
| SAML signing certificate | Entra signing assertions to your system (pattern 2) | By default 3 years; the date can be chosen when creating one | A person in the client's tenant, then your system must be updated |
| Provisioning credential | Entra connecting to your SCIM endpoint (pattern 4) | Set by your system, so whatever you chose | You 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.
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.
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) | Effect | Why a support engineer cares |
|---|---|---|
| Restrict max password lifetime | Caps how long a client secret may last | The client may be unable to create the lifetime you asked for; secrets may be short, so renewals are frequent |
| Restrict max certificate lifetime | Caps how long a certificate credential may last | Likewise for certificates (Microsoft's own example uses 180 days) |
| Block password addition | Prevents any new secret being added to applications | A client may be unable to renew a secret at all and must move to a certificate or federated credential |
| Block multitenant applications | Prevents apps being created or promoted as multitenant | Can 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 see | Look at |
|---|---|
| Client secrets and certificates | Entra ID > App registrations > (the app) > Certificates & secrets, which lists each credential with its expiry |
| SAML signing certificate | Entra 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-wide | Entra 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 reports | Most likely | First 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 certificate | Expiry 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 access | Credential 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 quarantined | The 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 user | Ask 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 side | Chapter 3's step 6 |
Hands-On Exercises
All three use fictional data. "Today" in the exercises is 1 October 2026.
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 solutionAudit 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.
| # | Item | Type | Created | Expires |
|---|---|---|---|---|
| 1 | Acme sign-in (Fabrikam tenant) | Client secret | 2025-01-15 | 2026-10-20 |
| 2 | Acme SAML SSO (Contoso tenant) | SAML signing certificate | 2023-11-25 | 2026-11-25 |
| 3 | Directory sync job (Fabrikam tenant) | Client secret | 2024-09-28 | 2026-09-28 |
| 4 | User provisioning (Contoso tenant) | SCIM credential we issued | 2026-03-01 | 2027-03-01 |
| 5 | Reporting API job (Contoso tenant) | Certificate credential | 2025-02-14 | 2027-02-14 |
| 6 | Test app (Fabrikam tenant) | Client secret | 2026-09-30 | 2028-12-01 |
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 solutionChapter 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