Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue reported on #2338 is still an issue, please reopen. #3181

Closed
alisalih1 opened this issue Feb 25, 2025 · 4 comments
Closed

Issue reported on #2338 is still an issue, please reopen. #3181

alisalih1 opened this issue Feb 25, 2025 · 4 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@alisalih1
Copy link

Describe the bug

Get-MgUserDefaultDrive still not working, please refer to #2338 for details. Get-MgUserDefaultDrive -UserId XXXXXXXXX returns access denied when neccesary scopes are in place.

Expected behavior

Get-MgUserDefaultDrive still not working, please refer to #2338 for details.

How to reproduce

Get-MgUserDefaultDrive -UserId XXXXXXXXX returns access denied when neccesary permissions are in place.

SDK Version

2.26.0

Latest version known to work for scenario above?

No response

Known Workarounds

N/A

Debug output

DEBUG: [CmdletBeginProcessing]: - Get-MgUserDefaultDrive begin processing with parameterSet 'Get'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'InteractiveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line Tools'.
DEBUG: [Authentication]: - Scopes: [DeviceManagementConfiguration.Read.All, Directory.Read.All, Directory.ReadWrite.All, Files.Read.All, Group.Read.All, Mail.Read, openid, profile, Reports.Read.All, Sites.Read.All, Team.ReadBasic.All, User.Read, User.Read.All, email, Sites.ReadWrite.All].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/v1.0/users/staffXXXXXXXXXXX.com/drive

Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.22631; en-US),PowerShell/7.4.4
SdkVersion : graph-powershell/2.26.0
client-request-id : 061dd456-4084-4270-9d92-da93956779ab
Accept-Encoding : gzip,deflate,br

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
Forbidden

Headers:
Cache-Control : no-store, no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : bff41ce0-adc0-43f1-9af2-13b28a809d9a
client-request-id : 061dd456-4084-4270-9d92-da93956779ab
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"South Central US","Slice":"E","Ring":"5","ScaleUnit":"000","RoleInstance":"SA2PEPF00002DF4"}}
Date : Tue, 25 Feb 2025 15:29:48 GMT

Body:
{
"error": {
"code": "accessDenied",
"message": "Access denied",
"innerError": {
"date": "2025-02-25T15:29:48",
"request-id": "bff41ce0-adc0-43f1-9af2-13b28a809d9a",
"client-request-id": "061dd456-4084-4270-9d92-da93956779ab"
}
}
}

Configuration

x64, Windows 11.

Other information

No response

@alisalih1 alisalih1 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Feb 25, 2025
@12Knocksinna
Copy link

Is this with an interactive (delegated) session or with an app-only session? Any time I go near OneDrive, I use app-only mode to be sure that application permissions will work. Get-MgUserDrive works very well in this mode. When you run a delegated session, your permissions won't allow access to someone else's OneDrive unless you are a manager of that drive.

@alisalih1
Copy link
Author

Is this with an interactive (delegated) session or with an app-only session? Any time I go near OneDrive, I use app-only mode to be sure that application permissions will work. Get-MgUserDrive works very well in this mode. When you run a delegated session, your permissions won't allow access to someone else's OneDrive unless you are a manager of that drive.

After reviewing the end-point documentation, I was coming here to close this issue. It was delegated vs. App-only issue.

@SteveMutungi254
Copy link
Contributor

Thank you, @12Knocksinna, for your insight and for shedding light on the solution!

@12Knocksinna
Copy link

12Knocksinna commented Feb 25, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

3 participants