Open JonoSuave opened 4 months ago
Are you seeing any other errors in the console? Something about an iframe being blocked?
Here's the main error I'm seeing (I redacted the actual tenantId): "ServerError: invalid_resource: AADSTS500011: The resource principal named api:/ was not found in the tenant named {tenantId}. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: 1ab30c7e-cfff-4f64-b671-a96f9bab0600 Correlation ID: f4d3aa27-fd74-440b-ab4d-3d13b65c6d7a Timestamp: 2024-05-21 18:33:44Z"
I can confirm the tenantId is the correct tenantId. Attached are my app registrations.
There are some redundant configurations, but mostly there's a mismatch between your elements.xml and app registration.
Your xml has api://e018f88b-07b9-4f80-997f-fb5810ac4a5d/SharePoint.Read but I'm not seeing this scope in your copilot app registration
Looks the same to me?
Oh, it's just not the original elements.xml you posted :)
Based on your error, it still looks like there is a configuration mismatch: 1. only your copilot app registration needs to expose a custom api, and your custom canvas app registration needs to have permissions on that api 2. in elements.xml, clientID needs to point at the canvas app registration and the custom scope that belongs to the bot app registration
Oh yes, that was from another demo I was working on -- sorry about that. So should there be a third app registration for a bot app registration? Right now I have the customScope pointed to the api endpoint of the exposed api from the Copilot Studio Demo app registration.
No, luckily a third one isn't required. Let's review the setup:
This app will also expose the api/custom scope
Canvas app registration - needs a permission over the custom scope exposed by (1)
elements.xml - needs to point to the custom scope defined in (1) and the client ID of (2)
@JonoSuave ?
I set up both the CoPilot and SharePoint canvas app registrations according to the guide. I also configured my elements.xml file like so for my demo tenant:
I installed the spfx extension in my site, but when click on the button I receive the following error in the console: InteractionRequiredAuthError: no_tokens_found: No refresh token found in the cache. Please sign-in
I must be missing something in my registered apps Expose an API section? ![Uploading Screenshot 2024-05-14 at 9.38.49 PM.png…]()