Using form authentication with my own tables

I have a little db, nothing fancy only 5 tables. I would like to use forms authentication, but it creates its own db to perform its actions. I don’t need anything interesting, and of course I don’t need the added infrastructure, but I would like for security forms authentication to be provided. I have a table with username and password. how can i do this so that forms use these fields and return my user id? is it even possible with forms? if not, how can I do this, so that the forms create its infrastructure on my db, so I can combine my tables with those forms that should work?

I know that this is probably pretty simple, but I did not find anything on the net after several hours of research.

+3
source share
3 answers

If you want to use your own tables, you need to implement your own MemberhipProvider . This allows you to use your own tables and stored procedures, but still connect to the auth forms structure.

+1
source

Actually, I'm not sure why the answers here imply that Forms Authentication should somehow be used with the ASP.Net Membership or the ASP.Net infrastructure for it (providers, etc.).

Autodesk Forms Authentication ( ASP.Net , ).

MSDN:

<script runat="server">
  void Logon_Click(object sender, EventArgs e)
  {
    if ((UserEmail.Text == "jchen@contoso.com") && 
        (UserPass.Text == "37Yj*99Ps"))
      {
          FormsAuthentication.RedirectFromLoginPage 
             (UserEmail.Text, Persist.Checked);
      }
    else
      {
          Msg.Text = "Invalid credentials. Please try again.";
      }
  }
</script>

, , db....

: ( ​​, MSDN)

+3

All Articles