question

Tester-4121 avatar image
0 Votes"
Tester-4121 asked saldana-msft edited

I try to download the file in one drive. I got this error, me request is only valid with delegated authentication flow. How to solve this issue?

I try to download the file in one drive. I got this error, me request is only valid with delegated authentication flow. How to solve this issue? In below I add the permissions

microsoft-authenticatormicrosoft-graph-users
· 6
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.

@Tester-4121 What error are you getting?

0 Votes 0 ·

me request is only valid with delegated authentication flow

0 Votes 0 ·

I get the below error:

"error": {
"code": "BadRequest",
"message": "/me request is only valid with delegated authentication flow.",
"innerError": {
"date": "2021-09-30T18:50:40",
"request-id": "f4431d06-9434e-4f1d-9434-43a763256a3b",
"client-request-id": "1e3c1d06-943f-4f1d-94334-44a7633276a3b"
}
}
}

0 Votes 0 ·
Show more comments

Hello @Tester-4121, would you mind providing the API you are using and any screenshot of your error message?

0 Votes 0 ·
Tester-4121 avatar image Tester-4121 ZehuiYaoMSFT-7151 ·

I get the below error:

"error": {
"code": "BadRequest",
"message": "/me request is only valid with delegated authentication flow.",
"innerError": {
"date": "2021-09-30T18:50:40",
"request-id": "f4431d06-9434e-4f1d-9434-43a763256a3b",
"client-request-id": "1e3c1d06-943f-4f1d-94334-44a7633276a3b"
}
}
}

0 Votes 0 ·
CarlZhao-MSFT avatar image
0 Votes"
CarlZhao-MSFT answered CarlZhao-MSFT commented

Hi @Tester-4121

That's the problem, the /me endpoint only supports the delegated authentication flow, you should use the auth code flow or the ROPC flow to get the access token.


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.

· 4
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.

No, Again and again, the same issues are coming. /me request is only valid with delegated authentication flow.

0 Votes 0 ·

@Tester-4121 If you are using delegated authentication flow then this error should not occur, please use https://jwt.ms/ to parse your access token and share a screenshot.

0 Votes 0 ·

Hi @Tester-4121 Would you please provide us with an update on the status of your issue?

0 Votes 0 ·

Hi @Tester-4121

Is there anything else I can help with regarding this issue?

You can comment us at any time and we will continue to follow up.

Thanks,
Carl Zhao

0 Votes 0 ·
ShivamDhiman-1582 avatar image
0 Votes"
ShivamDhiman-1582 answered

Hi @Tester-4121

I am able to replicate the same issue when i use Application token.
200200-error1.png


To get the drive file content I suggest you to use Get users/{own-email-Address} in your endpoint to get the desired result. Graph API endpoint GET /users/{user-email-Id}/drive/items/{item-id}/content

Result:
200168-user2.png

Hope this helps,

If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".


error1.png (93.6 KiB)
user2.png (47.3 KiB)
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.