The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hello @Prajwal K Divate
Based on my research, when a user opens an anonymous sharing link (scope: "anonymous"), SharePoint establishes an anonymous session in the browser and stores this context using cookies. Any subsequent requests in the same browser session continue to operate under this anonymous context.
When the user then tries to open a user-specific link (scope: "users"), SharePoint expects an authenticated identity that matches the user the link was granted to. However, the browser is still using the anonymous session, creating a mismatch. This results in the “You don’t have permission to access this item” (or “You can’t access this site”) error.
This behavior is consistent with SharePoint’s session-identity handling: access fails when the current session context does not match the account the link was granted to.
As practical workarounds, you may consider:
- Open the anonymous link in a separate browser context (new window, incognito/private mode, or different browser/profile).
- Open the user-specific link first, then the anonymous one (the reverse order avoids the conflict).
- Ensure users are fully authenticated (signed in with the correct account) before opening the user-specific link.
- Avoid mixing anonymous and user-specific links in the same user flow if possible.
I hope this clarifies the behavior.
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.