Unable to create onedrive subscription to drive: Status Code: Unauthorized; Reason: Unauthenticated

Josh 1 Reputation point
2023-10-20T08:32:10.78+00:00

when creating subscription to onedrive webhook, I always get 401Unauthorized, but the token is not expired and granted with desired permission

{
    "error": {
        "code": "ExtensionError",
        "message": "Operation: Create; Exception: [Status Code: Unauthorized; Reason: Unauthenticated]",
        "innerError": {
            "date": "2023-10-20T08:27:30",
            "request-id": "665565b5-f22d-4b06-bf22-ab8ce50ad1e8",
            "client-request-id": "665565b5-f22d-4b06-bf22-ab8ce50ad1e8"
        }
    }
}

endpoint: https://graph.microsoft.com/v1.0/subscriptions

{
 "changeType": "updated",
 "notificationUrl": "xxx",
 "resource": "/me/drive/root",
 "expirationDateTime": "2023-10-20T11:23:00.000Z",
 "clientState": "client-specific string"
}


with access token permission

{
    "token_type": "Bearer",
    "scope": "Files.Read Files.ReadWrite.All Files.ReadWrite Files.Read.All",
    "expires_in": 3600,
    "ext_expires_in": 3600,
	...
}

Any ideas?

OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
866 questions
0 comments No comments
{count} votes