0

I am kinda new to asp.net. I used asp backing flash for most of the site work i have done, but I have shied away from flash and I am having some issues understanding asp.net membership.

I am currently using the web.config file to set the credentials for forms authentication. I would like to store the member credentials in an xml file, but I can only seem to find examples on the net about how to store the credentials in an sql database. I could create my own authentication system using session variables and xml. But it is mentioned all over the net that this is frowned upon.

So how do i save member information in a separate xml file? and if I do. is there a difference in how I authenticate a user?

I would like to also point out that I am using a webserver that supports only asp.net 2.0

Edited by Diamonddrake: n/a

4
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by crishjeny
0

> I would like to store the member credentials in an xml file

Yes you can do that. There are number of ways/methods to store/retrieve and compare the credentials.

Tutorials:

1. Forms Authentication Using An XML Users File
2. Examining ASP.NET's Membership, Roles, and Profile - Part 1 to Part 18
3. http://www.developer.com/security/article.php/11580_3364361_2/Two-Quick-Ways-to-Perform-ASPNET-Authentication.htm


EDIT:

Please read MSDN article - Securing Your ASP.NET Application and Web Services.

Edited by __avd: n/a

0

Alright, Thanks.
The part i didn't get was calling authenticate. Turns out that's not what creates the cookie. The trick was calling FormsAuthentication.RedirectFromLoginPage. That's what authorizes the user. That's where I were confused.

I have seen it done that custom memebership providers were created, and I had it in my head that this was the only way to do it. But apparently calling FormsAuthentication.RedirectFromLoginPage Does all the magic.

thanks, That 4guysfromrolla's a good read.

0

Beware when you write to the XML file. Your app is a multi-user system & 2 or more users changing the file at the same time could overwrite each others changes.

0

That's a good point, but its my personal site and the only authenticated user will be me. I just wanted a non web.config way of storing my username and password.

If I were really serious about it, since my hosting doesn't support mysql, I would use an access database, But I have recently gotten into using XML file to store all my data for my site and I'm very happy with it so far.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.