Microsoft Graph Toolkit

I've tried integrating this via an html component and adding the script via libraries.

https://mgt.dev/?path=/story/components-mgt-login--login&source=ge

but nothing shows up.

Have you tried it as a Custom Component? The <template> will require JS to get it to render which you will not be able to do in the HTML component.

should the

be in the iframe code or inside Scripts and styles?

I have this but still nothing in the custom component

<script src="https://unpkg.com/@microsoft/mgt/dist/bundle/mgt-loader.js"></script>
<mgt-login></mgt-login>
<mgt-agenda></mgt-agenda>

This doc on Custom Components will be able to best guide your initial build process

yeah i've gone through it but haven't' made any progress.

this should load in the component?

<mgt-msal2-provider client-id="<YOUR_CLIENT_ID>"></mgt-msal2-provider>
<mgt-login></mgt-login>

Hey @nroeder!

Unfortunately, it appears as though this script doesn't work within Retool. It looks as though the script doesn't support being dynamically loaded, we force script tags to become asynchronous when they're loaded into custom components so as to prevent them from blocking other scripts being run in your app. In this case, though, that leads to the following which you might have seen in your browser console:

Failed to execute 'write' on 'Document': It isn't possible to write into a document
from an asynchronously—loaded external script unless it is explicitly opened.

It also adds more scripts and styles to the iframe which causes issues, and, finally, the login button that would be generated doesn't support redirects from an iframe:

All this means that we're pretty out of luck with this particular library :pensive:

Is it possible to create a ressource Microsft Graph with Oauth2, I tried to setup with OAUTH2 directly integrated with Retool, it works. Then I use table and other object to manipulate my file / folder in sharepoint list.
Microsoft said its possible to use a custom provider, so I will try by creating a custom oauth.