The error message "Authorization has been denied for this request" typically indicates that there is an issue with the token being used for authentication. Since you mentioned that the access token retrieval is successful and the tokens match except for the tenant ID (tid), this suggests that the token may not be valid for the tenant you are trying to send the proactive message to.
Here are some points to consider:
- Tenant ID Mismatch: The tid in the access token must match the tenant ID of the Microsoft Teams environment you are trying to access. If the tid does not match, the authorization will fail even if the token is valid for another tenant.
- Single-Tenant vs Multi-Tenant: You mentioned switching to a single-tenant model. If your bot is registered as single-tenant, it will only work with users from the same tenant. Ensure that the bot's app registration is correctly configured for the tenant you are targeting.
- Proactive Messaging Requirements: When sending proactive messages, ensure that you are using the correct service URL and that you have called
MicrosoftAppCredentials.TrustServiceUrlbefore sending the message. This is crucial for authorization to succeed. - Documentation Updates: As for the deprecation of multi-tenant bot creation, it is advisable to follow the latest guidelines provided in the documentation. If you are using a multi-tenant setup, consider migrating to a single-tenant model as recommended.
- Common Issues: Since multiple users are facing the same issue, it could be beneficial to check if there are any known service issues or bugs affecting the Bot Framework in the specific tenant.
If the problem persists, you may want to review the authentication flow and ensure that all configurations are set correctly according to the latest documentation.