How to access Microsoft Graph APIs for my asp.net Web Form including authentication?

Jeeva Anbalagan 11 Reputation points
2021-08-27T08:42:00.097+00:00

I am using ASP.Net Web forms but not in MVC pattern. In this, i would like to authenticate my web app using MS Graph API and how to access any MS Graph APIs further into the site? need some help on this.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,569 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,252 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Shweta Choudhary 601 Reputation points Microsoft Employee
    2021-08-30T10:57:19.047+00:00

    Thank you for reaching out.

    Microsoft Graph enables developers to consume user information stored in Microsoft 365 in custom applications. Data is retrieved from Microsoft Graph through a REST API or using one of the various native SDKs provided by Microsoft.

    Follow this tutorial to learn how to work with the Microsoft Graph .NET SDK to create an ASP.NET web application to access data in Microsoft 365

    Thanks.


  2. Rolling stones 1 Reputation point
    2021-09-23T13:13:24.333+00:00

    How to access microsoft graph toolkit from my asp.net Web Form ?

    I am using ASP.Net Web forms but not in MVC pattern. In this, i would like to add to my application MS Graph Toolkit by adding tag into my aspx page susch as <mgt-agenda></mgt-agenda>, I need some help on this. I have tried to add the javascript library but it doesn't work.

    dotnet-aspnet-webforms microsoft-graph-toolkit


  3. Bruce (SqlWork.com) 55,601 Reputation points
    2024-02-16T16:31:20.5366667+00:00

    the MS Graph Toolkit is a javascript library. there are two forms, the react library (used by the office team) and a web components library based on a new browser technology.

    https://developer.mozilla.org/en-US/docs/Web/API/Web_components

    this would be an alternative to writing a webform application. Instead you write a javascript app. a webform page can host an javascript application. for ajax to call the server, you would typically use use page webmethods, but you can add webapi support to webforms app and have the ajax call webapi methods.

    the webform server can call the graphapi using the bearer token passed in the ajax calls. if the server needs to validate the token, then you need to add the owin middleware to your project and use its oauth support

    https://learn.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-middleware-in-the-iis-integrated-pipeline

    0 comments No comments