@GIQUIAUD, Fabien - Thanks for bringing this issue to our attention.
Copilot Studio agents that use SharePoint knowledge sources currently lose authentication after the initial use in Teams. As a result, users need to re-authorize daily, which poses challenges for enterprise deployment.
The main reasons for this issue are:
- SharePoint access tokens expire after one hour
- The Teams client may cache stale tokens
- Authentication refresh between Copilot Studio, Teams, and SharePoint can fail
Here are some quick workarounds:
- Opt for app-only authentication rather than delegated user permissions.
- Set up explicit SharePoint permissions for the Copilot Studio service principal.
- Consider switching to Microsoft 365 Copilot Agents (declarative agents) for improved SharePoint integration.
- For greater production control, implement a Custom Engine Agent that makes direct SharePoint API calls.
For an enterprise solution, it’s recommended to build a Custom Engine Agent using the Teams AI SDK, ensuring proper token management and robust retry logic.
Reference Documents:
https://v4.hkg1.meaqua.org/en-us/microsoft-copilot-studio/knowledge-copilot-studio
https://v4.hkg1.meaqua.org/en-us/microsoft-copilot-studio/configuration-end-user-authentication