Chapter 30 · Entra App Registration
Subchapter 30.16
references/troubleshooting.mdMarkdown7 KBView on GitHub
This guide helps you diagnose and fix common issues with app registrations and authentication.
Error message:
AADSTS50011: The redirect URI 'http://localhost:3000' specified in the request
does not match the redirect URIs configured for the application.Cause: The redirect URI in your authentication request doesn’t exactly match what’s registered.
Solutions:
Check exact match (case-sensitive, trailing slash matters):
Registered: https://myapp.com/callback
Request: https://myapp.com/callback/ ❌ (trailing slash)
Request: https://MyApp.com/callback ❌ (case difference)
Request: https://myapp.com/callback ✅Add URI to app registration:
# Portal: Authentication → Add redirect URI
# CLI:
az ad app update --id $APP_ID \
--web-redirect-uris "http://localhost:3000" "https://myapp.com/callback"Check platform type:
Error message:
AADSTS7000215: Invalid client secret provided.
Ensure the secret being sent in the request is the client secret value, not the client secret ID.Causes:
Solutions:
az ad app credential list --id $APP_IDaz ad app credential reset --id $APP_ID --years 1password value (not the keyId)Error message:
AADSTS65001: The user or administrator has not consented to use the applicationCauses:
Solutions:
Grant admin consent (if admin):
az ad app permission admin-consent --id $APP_IDRequest user consent (interactive flow): This requires the client app to have access to UI such as browser, terminal window, etc. Follow the best practices of your client app to implement the interactive flow.
Check API permissions in portal:
Error message:
AADSTS70000: The request was denied because one or more permissions have been declinedCause: User or admin explicitly denied consent.
Solutions:
Re-request with explanation:
Check if admin consent is required:
Reduce permission scope:
Error message:
AADSTS700016: Application with identifier '{app-id}' was not found in the directoryCauses:
Solutions:
Verify application ID:
az ad app list --display-name "MyApp" --query "[].{Name:displayName, AppId:appId}"Verify tenant ID:
az account show --query tenantId -o tsvError message:
The app is trying to access a service 'your_app_id'(your_app_name) that your organization 'your_tenant_id' lacks a service principal forCauses:
Solutions:
az ad sp create --id $APP_IDError message:
AADSTS90014: The required field 'client_id' is missing from the requestThis can happen if the client you are using isn’t compatible with Entra. Consult the owner of your client app to see if it supports Entra.
Unless the the access token is encrypted, you can decode and view its claims securely at https://jwt.ms (opens in a new tab). Don’t use any other website to decode an access token. Compare the claims in the token with the app registration’s configuration to identify issues.
How to use:
aud - Audience (should match your API)iss - Issuer (should be login.microsoftonline.com)scp - Delegated permissionsroles - Application permissionsexp - Expiration timestampoid - User object IDUse for: Inspecting HTTP requests/responses
What to check:
Bearer {token}Access: Azure Portal → Microsoft Entra ID → Sign-in logs
What to check:
| Error Code | Meaning | Common Cause |
|---|---|---|
| AADSTS50011 | Redirect URI mismatch | URI not registered or doesn’t match |
| AADSTS50020 | Invalid tenant | Wrong tenant in authority URL |
| AADSTS50034 | User not found | User doesn’t exist in tenant |
| AADSTS50053 | Account locked | Too many failed attempts |
| AADSTS50055 | Password expired | User needs to reset password |
| AADSTS50057 | Account disabled | User account disabled |
| AADSTS50058 | Silent sign-in failed | Interactive auth required |
| AADSTS50059 | Tenant not found | Invalid tenant ID |
| AADSTS65001 | Consent required | User/admin hasn’t consented |
| AADSTS70000 | Grant declined | User denied consent |
| AADSTS70001 | App disabled | App registration disabled |
| AADSTS700016 | App not found | Invalid app ID or wrong tenant |
| AADSTS7000215 | Invalid client secret | Wrong/expired secret |
| AADSTS90014 | Missing field | Required parameter not sent |
| AADSTS90072 | Consent needed | Admin consent required |
Collect information:
Check basics first:
Use debugging tools:
Test incrementally: