{"id":24225856,"url":"https://github.com/mmsharepoint/tab-sso-graph-file-conversion","last_synced_at":"2025-07-12T05:02:21.900Z","repository":{"id":102379045,"uuid":"608046603","full_name":"mmsharepoint/tab-sso-graph-file-conversion","owner":"mmsharepoint","description":"A Teams tab using Microsoft Graph capability to convert numerous file types to several target types (PDF,HTML,JPG,...)","archived":false,"fork":false,"pushed_at":"2023-03-10T18:53:17.000Z","size":1163,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T04:13:41.585Z","etag":null,"topics":["hack-together","microsoft-graph-sdk"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mmsharepoint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-01T07:54:10.000Z","updated_at":"2023-03-06T09:31:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"b69027b8-3e1d-47ae-9321-bc5c32503f6f","html_url":"https://github.com/mmsharepoint/tab-sso-graph-file-conversion","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mmsharepoint/tab-sso-graph-file-conversion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsharepoint%2Ftab-sso-graph-file-conversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsharepoint%2Ftab-sso-graph-file-conversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsharepoint%2Ftab-sso-graph-file-conversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsharepoint%2Ftab-sso-graph-file-conversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmsharepoint","download_url":"https://codeload.github.com/mmsharepoint/tab-sso-graph-file-conversion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmsharepoint%2Ftab-sso-graph-file-conversion/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264940367,"owners_count":23686241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hack-together","microsoft-graph-sdk"],"created_at":"2025-01-14T08:16:41.073Z","updated_at":"2025-07-12T05:02:21.888Z","avatar_url":"https://github.com/mmsharepoint.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tab-sso-graph-file-conversion\n\n## Summary\nThis Teams Tab enables a user to upload a supported (depending on the target) file type via drag and drop while the uploaded file will be converted as PDF, HTML, JPG depending on user's selection.\nIn Teams context (as configurable Tab) it uses the current Teams' site and the default drive. In case of a personal tab the SharePoint root site's default drive'\nIt uses the following capabilities (mostly) on behalf of Microsoft Graph:\n* Use HTML5 drag and drop event handling\n* Writing normal files smaller 4MB\n* Writing files bigger than 4MB with a resumable upload\n* Retrieving files with format=pdf/html/jpg conversion which is currently supportred only with Graph beta endpoint\n\nSelect target file type:\n\n![File upload and JPG conversion](assets/01SelectFileType.gif)\n\nFile upload and JPG conversion\n\n![File upload and JPG conversion](assets/02UploadPNGfile.gif)\n\nSwitch between drag\u0026drop and file upload:\n\n![Switch between drag\u0026drop and file upload](assets/03SelectUploadOption.gif)\n\nFor further details see the author's [blog post](https://mmsharepoint.wordpress.com/2023/03/10/file-conversion-in-a-teams-tab-with-microsoft-graph-and-teams-toolkit-for-visual-studio-c/)\n\n## Applies to\n\nThis sample was created [using the Teams Toolkit with Visual Studio 2022](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/teams-toolkit-fundamentals?pivots=visual-studio\u0026WT.mc_id=M365-MVP-5004617). The sample was also realized with Graph v1.0 enpoint as [PDF only conversion](https://github.com/mmsharepoint/tab-sso-graph-upload-pdf-csharp) and can be found [here](https://github.com/mmsharepoint/tab-sso-graph-upload-as-pdf).\n\n## Version history\n\nVersion|Date|Author|Comments\n-------|----|--------|--------\n1.0|Mar 10, 2023|[Markus Moeller](http://www.twitter.com/moeller2_0)|Initial release\n\n## Disclaimer\n\n**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**\n\n---\n## Minimal Path to Awesome\n- Clone the repository\n    ```bash\n    git clone https://github.com/mmsharepoint/tab-sso-graph-file-conversion.git\n- Open tab-sso-graph-file-conversion.sln in Visual Studio\n- Perform first actions in GettingStarted.txt (before hitting F5)\n- This should [register an app in Azure AD](https://learn.microsoft.com/en-us/microsoftteams/platform/toolkit/add-single-sign-on?pivots=visual-studio\u0026WT.mc_id=M365-MVP-5004617#add-sso-to-teams-app-for-visual-studio)\n- Ensure there is an app \n  - with redirect uri https://localhost/blank-auth-end.html\n  - SignInAudience multi-tenant\n  - with client secret\n  - with **delegated** permissions Files.ReadWrite and Sites.ReadWrite.All\n  - With exposed Api \"access_as_user\" and App ID Uri api://localhost/\u003cApp ID\u003e\n  - With the client IDs for Teams App and Teams Web App 1fec8e78-bce4-4aaf-ab1b-5451cc387264 and 5e3ce6c0-2b1f-4285-8d4b-75ee78787346\n- Find/Add the app registration ClientId, ClientSecret to your appsettings.json (or a appsettings.Development.json)\n- Find/Fill OAuthAuthority with https://login.microsoftonline.com/_YOUR_TENANTID_\n- Grant admin consent to the given permissions in the app registration\n- Now you are good to go to continue in GettingStarted.txt with hitting F5 (You can also select an installed browser in the VS menu)\n\n## Features\nThis is a simple Teams Tab. It enables a user to upload a supported file type via drag and drop or file upload while the uploaded file will be converted as PDF, HTML or JPG.\n* SSO access token generation to access Microsoft Graph\n* Call backend controller to execute O-B-O flow and Microsoft Graph requests\n* [Upload large files with Microsoft Graph](https://learn.microsoft.com/en-us/graph/sdks/large-file-upload?tabs=csharp?WT.mc_id=M365-MVP-5004617)\n* [Convert supported files to various target formats with Microsoft Graph](https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-beta\u0026tabs=http\u0026WT.mc_id=M365-MVP-5004617)\n  * Use HttpClient for this as the endpoint is beta and in the latest Microsoft Graph .NET SDK there is a [bug](https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/1621) in the format conversion option.\n* [Use Fluent UI Web Components with Blazor](https://learn.microsoft.com/en-us/fluent-ui/web-components/integrations/blazor?WT.mc_id=M365-MVP-5004617)\n\n[![Hack Together: Microsoft Graph and .NET](https://img.shields.io/badge/Microsoft%20-Hack--Together-orange?style=for-the-badge\u0026logo=microsoft)](https://github.com/microsoft/hack-together)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmsharepoint%2Ftab-sso-graph-file-conversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmsharepoint%2Ftab-sso-graph-file-conversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmsharepoint%2Ftab-sso-graph-file-conversion/lists"}