Home > Mobile >  login with microsoft api in asp net framework (webforms)
login with microsoft api in asp net framework (webforms)

Time:11-07

I've searched a lot but unfortionalitly I didn't find the correct answer for my case. I need to add a button in my webform page to use it to login with microsoft account and after login I get a response which has a token and email (I'll use them then). I need to do the normal approach to login with third party (authentication) note: I don't use identity in this project. Most of the solutions I found belong to MVC but in this project I use webforms.

CodePudding user response:

Well, if you going to use a whole new 100% different logon system, and a whole new 100% different authentication provider?

You have little choice - you have to add that authentication provider to that asp.net site. There really no other way around this.

You thus have to add owin to your existing application.

so you can setup a whole new authentication system for your web site. Certainly not for the fait of heart, and VERY MUCH BEYOND the scope of a simple question answer site like SO.

But there are a good number of articles and step by step on this, such as:

https://tomasherceg.com/blog/post/modernizing-asp-net-web-forms-applications-part-2#:~:text=OWIN can be integrated with ASP.NET quite easily,combination with Web Forms pages (or MVC controllers).

So, you at the end of the day really need to add identity authentication to your site. https://docs.microsoft.com/en-us/aspnet/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project#:~:text=Select New Project from the Start page, or,New ASP.NET Project dialog, select the Empty template.

CodePudding user response:

finally I found the solution It's a simple and suits to my case which I use webforms not MVC https://docs.microsoft.com/en-us/graph/auth-v2-user

  • Related