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.