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.
2
Answers
finally I found the solution It suits to my case which I use webforms not MVC ( without identity ) https://learn.microsoft.com/en-us/graph/auth-v2-user
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%20can%20be%20integrated%20with%20ASP.NET%20quite%20easily,combination%20with%20Web%20Forms%20pages%20%28or%20MVC%20controllers%29.
So, you at the end of the day really need to add identity authentication to your site.
https://learn.microsoft.com/en-us/aspnet/identity/overview/getting-started/adding-aspnet-identity-to-an-empty-or-existing-web-forms-project#:~:text=Select%20New%20Project%20from%20the%20Start%20page%2C%20or,New%20ASP.NET%20Project%20dialog%2C%20select%20the%20Empty%20template.