question

GillorGeva-2105 avatar image
1 Vote"
GillorGeva-2105 asked ZehuiYaoMSFT-7151 edited

403 Forbidden while uploading encrypted file to onedrive

I have a file on OneDrive that is labeled and encrypted with Microsoft Information Protection SDK.
I'm trying to replace this encrypted file with another one (encrypted or non-encrypted) and getting 403 Forbidden.
this is the API I'm using:
PUT /users/{user-id}/drive/items/{item-id}/content

Note that when replacing a non-encrypted file the api works perfectly fine.

I tried inspecting the token on jwt.ms and these are the permissions I have:
"Sites.Selected",
"Mail.ReadWrite",
"User.ReadWrite.All",
"Domain.ReadWrite.All",
"Calendars.Read",
"People.Read.All",
"Directory.ReadWrite.All",
"Sites.Read.All",
"Sites.ReadWrite.All",
"Sites.Manage.All",
"Files.ReadWrite.All",
"Directory.Read.All",
"User.Read.All",
"InformationProtectionContent.Write.All",
"Files.Read.All",
"Mail.Read",
"Directory.Write.Restricted",
"Calendars.ReadWrite",
"InformationProtectionPolicy.Read.All",
"Contacts.Read",
"InformationProtectionContent.Sign.All",
"Sites.FullControl.All"

can't figure why I'm getting the 403 and what permissions do I need to add, tried many but nothing changed.

Thanks

microsoft-graph-applicationsmicrosoft-graph-permissions
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @GillorGeva-2105 , I'm currently doing some research on this issue, will let you know as soon as possible.

0 Votes 0 ·

Hello @GillorGeva-2105, would you mind providing a screenshot of the error message you received? I am trying to reproduce your problem.

0 Votes 0 ·

Thanks for the response.
I'm trying to upload from Java code.
This is the request that I use: PUT /users/{user-id}/drive/items/{item-id}/content
and the response I get is 403 Forbidden.

0 Votes 0 ·

1 Answer

ZehuiYaoMSFT-7151 avatar image
0 Votes"
ZehuiYaoMSFT-7151 answered ZehuiYaoMSFT-7151 edited

Hello @GillorGeva-2105, I think the main reason for the 403 error is that the file is protected. I suggest trying to use a higher-level administrator account to access or contact the protection of the file. Hope this helps you.


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ZehuiYaoMSFT-7151 ,
I'm using client credentials and have no account. I control my access using the api permissions in azure portal.

0 Votes 0 ·

Hello @GillorGeva-2105, I suggest sending a UserVoice to support replacing encrypted file.


0 Votes 0 ·