Fix Microsoft Graph API Access Denied Error in Console Applications
Question details
The user needs to resolve an 'access denied' error when attempting to read messages through the Microsoft Graph API using a confidential console application.

- Product
- Microsoft Graph API
- Device & OS
- not provided
- Scenario
- Using a client ID, tenant ID, and client secret to authenticate a confidential console application for reading messages.
- Observed behavior
- The application returns an access-denied error despite having authentication credentials configured.
Ensure you have administrator access to the Azure Active Directory (Azure AD) admin center for the tenant where the application is registered, as you will need to verify app permissions.
Verify Application Permissions and Grant Admin Consent
Confidential console applications (daemon apps) run without a signed-in user, meaning they require 'Application' permissions and active administrator consent in Azure AD to access resources.
When using the client credentials flow (client ID and secret), the application cannot rely on delegated permissions. If the app only has delegated permissions configured, or if admin consent hasn't been granted for the application permissions, the Microsoft Graph API will reject requests with an access denied error.
Log in to the Azure Portal, search for 'Microsoft Entra ID' (formerly Azure Active Directory), select it, and click on 'App registrations' from the left sidebar.
Locate and select the specific console application you have registered to open its overview page.
Click on 'API permissions' under the Manage menu. Click 'Add a permission', choose 'Microsoft Graph', and then specifically select 'Application permissions'. Check the necessary permissions for your task (e.g., Mail.Read).
After adding the permissions, click the 'Grant admin consent for [Your Tenant Name]' button located above the permissions list. Confirm the action, and ensure a green checkmark appears in the status column.

Escalate to Microsoft Q&A Support
If permissions and client secrets are correctly configured but the issue persists, the problem may involve complex authentication flows requiring Microsoft Graph expertise.
Switch to WPS Office for a Seamless Productivity Experience
While resolving backend Microsoft Graph API configurations, you still need a reliable tool for your daily document management. WPS Office offers a free, highly compatible alternative to Microsoft Office, letting you create and edit documents, spreadsheets, and presentations with ease.
- 1. Visit the Official Website: Go to the official WPS Office website to find the correct version for your operating system.
- 2. Install the Software: Download the lightweight installer, run it, and follow the simple on-screen instructions.
- 3. Open Microsoft Formats Instantly: Launch WPS Office and directly open your existing .docx, .xlsx, or .pptx files with full formatting retention.

Frequently Asked Questions
What is the difference between Delegated and Application permissions in Microsoft Graph?
Delegated permissions require a signed-in user context and are typically used for desktop or web apps. Application permissions are used by background services or console applications running without a user context, and they strictly require administrator consent.
Why does my console app return 'Access Denied' even with a valid access token?
This usually happens if the generated access token lacks the necessary scopes (permissions) to perform the intended action. It can also occur if Application permissions were added in Azure AD but the 'Grant admin consent' button was never clicked by an administrator.
How do I check if my client secret has expired in Azure AD?
Go to your app registration in the Microsoft Entra ID (Azure Portal), select 'Certificates & secrets' from the left menu, and check the expiration date of your current client secret. If it has expired, generate a new client secret and update the credentials in your console application.




