Simple Authentication and registration process for a website through Membership schema


Posted Date:     Total Responses: 0    Posted By: dnyandeep   Member Level: Gold   Points/Cash: 30   


As you can see today many of websites and web application need authentication for using that service.
you can create your own such web service which authenticates and creates new user using any database language.But what happens sometimes by mistakes you may make some mistakes which may make a security flaw to your website.
To avoid it you can use Membership schema provided by asp.net.so that errors to be made by you becomes zero.

So lets start.

1.Configuring Your Web Application.
If you are using visual studio 2008 when you create new website web.config file is automatically created else create a new web.config file in your project.
Now in Menubar go to ASP.NET configuration.select the security tab,select authentication type link.Then you will see two options.
a)From Internet.
b)From Local Network.

Select "From Internet" and press done.
save all.

2.creating Webpages and coding.

The Authentication Code is like this

if (Membership.ValidateUser(Login1.UserName, Login1.Password))
{
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Login1.UserName, DateTime.Now, DateTime.Now.AddMinutes(50), Login1.RememberMeSet, "demo");
string hashticket = FormsAuthentication.Encrypt(ticket);

HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, hashticket);
Response.Cookies.Add(cookie);

string returnUrl = Request.QueryString["ReturnUrl"];
if (returnUrl == null) returnUrl = "~/Default.aspx";

Response.Redirect(returnUrl);
}


Benifits of this method:Less Coding,More inbuilt Security Features.

Attachments

  • Authenticaiondemo (688-10031-Authenticationdemo.zip)

  • Project Feedbacks

    Author: Member Level: BronzeRevenue Score: 1 out of 5
    send ur documentation to my id: yashokreddy_4u@yahoo.co.in


    Author: Member Level: SilverRevenue Score: 1 out of 5
    hi Please mail me the details of ur project.
    My id :-garimaa.agarwal@yahoo.in


    Author: Member Level: GoldRevenue Score: 2 out of 52 out of 5
    Hi,
    Its really nice. I would like learn such type of things.

    It will be greatful for me to send the files.

    Thanks Rakesh,
    Siva Sreenath


    Author: Member Level: GoldRevenue Score: 2 out of 52 out of 5
    Hi,
    Its really nice. I would like learn such type of things.

    It will be greatful for me to send the files.

    Thanks
    Siva Sreenath


    Post Feedback
    You must Sign In to post a feedback.
    Next Project: Library Management System
    Previous Project: online shopping portal

    Return to Project Index

    Post New Project


    Related Projects


    Top Contributors
    Today
      Last 7 Days
        more...

        Awards & Gifts

        Online Members

        More...
         
        Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India