How to Read SharePoint Files in Android with Microsoft Graph (Fix 403 Error)
Question details
The user needs to authenticate an Android application with Microsoft Graph to download and read SharePoint files without triggering a 403 Forbidden error.

- Product
- Microsoft Graph API
- Device & OS
- Android
- Scenario
- Developing an Android application that uses the Microsoft Graph API to access and read documents stored on a SharePoint site.
- Observed behavior
- The Android application encounters a 403 Forbidden response when making requests to the SharePoint file endpoints, indicating an authentication or permissions failure.
Ensure you have administrator access to your Microsoft Entra ID (formerly Azure AD) tenant to configure application registrations and grant necessary API permissions.
Register App and Authenticate via Microsoft Entra ID
Properly register the Android application to obtain an OAuth 2.0 access token via MSAL, ensuring the correct permissions are granted to bypass the 403 error.
A 403 Forbidden error when accessing SharePoint via Microsoft Graph usually means the access token lacks the required scopes (permissions). To fix this, your app must be registered in Microsoft Entra ID and configured to request explicit file access permissions.
Log in to the Microsoft Entra admin center, navigate to 'App registrations', and create a new registration for your Android application.
Under 'Authentication', add a platform for Android. You will need to provide your app's Package Name and the Signature Hash generated from your keystore.
Navigate to 'API permissions', click 'Add a permission', select 'Microsoft Graph', and choose 'Delegated permissions'. Search for and add permissions such as 'Files.Read.All' or 'Sites.Read.All'.
If you are requesting permissions that require administrative approval, click the 'Grant admin consent for [Tenant]' button in the API permissions screen to authorize the app globally.
Integrate the Microsoft Authentication Library (MSAL) into your Android project. Use it to acquire an access token interactively or silently, and include this token in the 'Authorization: Bearer' header of your Microsoft Graph HTTP requests.

Access Cloud Documents Easily with WPS Office for Android
If you are looking for a reliable way to view and manage SharePoint or OneDrive documents on your Android device without building custom apps, WPS Office is an excellent, free alternative to Microsoft Office. It offers powerful cloud integrations and full format compatibility.
- 1. Download WPS Office: Install the free WPS Office app from the Google Play Store on your Android device.
- 2. Connect Your Cloud Account: Open WPS Office, navigate to the Cloud tab, and select OneDrive/SharePoint to log in with your Microsoft credentials.
- 3. Read and Edit Documents: Tap on any document stored in your cloud to instantly read, edit, or share it directly from your phone.

Frequently Asked Questions
Why do I get a 403 Forbidden error even after obtaining a Graph API token?
A 403 Forbidden error typically occurs because the access token does not contain the specific permissions required for the SharePoint endpoint you are calling. Verify that 'Files.Read.All' or 'Sites.Read.All' was granted and that admin consent was provided in Microsoft Entra ID.
Can I use a personal Microsoft account to read SharePoint files via Graph API?
SharePoint access through Microsoft Graph generally requires a work or school account authenticated via Microsoft Entra ID. Personal accounts are typically restricted to accessing personal OneDrive files.
Where can I get implementation help for MSAL on Android?
You can find comprehensive documentation and Android code samples for MSAL on GitHub, or request tailored developer support within the official Microsoft Q&A community.




