how to authenticate users from login page against azure active directory?

Raki 481 Reputation points
2023-06-05T20:45:07.5666667+00:00

i am developing an web forms application, where i want to allow user a login page so that they can enter their user name and password through Azure Active directory and save their login activities to sql server. is that possible? if yes, could please provide me in details? i found article on mvc and core application but not on web forms.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,267 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,274 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,561 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2023-06-05T22:24:55.89+00:00

    Hello @Raki , in order to develop your own login page and be able to handle the user credentials you will need to implement the ROPC flow. This flow is not widely recommended and has some limitations, being lack of multi-tenant applications and MFA some of the more important ones. Take a look to Username and password authentication with MSAL.NET for more information on how to implement it in your ASP.NET WebForms application.

    That being said, the recommended approach is to use authentication flows that support Azure AD login UI such as the Authorization Code Flow. On succesful authentication you will obtain an ID token containing claims such as the oid that will allow you to keep track of sign-in activities. Take a look to OWIN security components in ASP.NET: OpenID Connect!, and Convert ASP.NET WebForms with Windows Authentication to use AAD.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.

    0 comments No comments

0 additional answers

Sort by: Most helpful