Re: How to implement a automatic login function



On Apr 5, 9:27 pm, stch...@xxxxxxxxxxxxxxxxxxxx (Steven Cheng[MSFT])
wrote:
Hi Rob,

Thanks for your input.

I think what you want to do is a bit different. What you want to do is like
a web client which programmatically send http post request to send login
credentials and pass the login page at server-side, just like many web
crawler does, correct?

For programmatically post http form data (through webrequest component in
.net), here are some useful web links:

#ASP.NET: Post Data Programmatically with "Webscraping"http://www.developer.com/net/asp/article.php/3645506

#Programmatically Posting Data to ASP .NET Web Applicationshttp://dndj.sys-con.com/read/45127.htm

#Https form post using Httpwebrequest brings back the same page.http://www.thescripts.com/forum/thread591965.html

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Thanks for the reply Steven,

Unfortunately, this is not what I am after.

I am simply trying to simulate a normal login. At the moment the site
uses the login control connected to the Membership class. Under a
normal login the CurrentUser is associated with the current session
and can be picked up on any page by Membership.GetUser(). As per your
suggestion earlier in this thread I've been able to pass in the
username and password via a post and authenticate using the
following.

If Membership.ValidateUser(UserName, Password) Then
FormsAuthentication.RedirectFromLoginPage(UserName, True)

At least I think it authenticates because no error is returned but I
can't really know for sure because I can pickup up the current user
name in the normal way as follows:

Dim CurrentUser As MembershipUser = Membership.GetUser()
Message.Text = "Login Successfull. User = " & CurrentUser.UserName

In this case Membership.GetUser() returns a null.

Regards,

RobGMiller

.



Relevant Pages

  • Elementary security questions
    ... easy to ensure that the login process was handled entirely over SSL, ... converting a request for the login page made via http into a request ... In my JSP ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: SSL Forms Authentication Redirect - Problem Redirecting out of HTTPS
    ... allowing an authentication cookie to be passed over an HTTP ... My login script goes into SSL just fine. ... The load balancer is maintaining server affinity. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: SSL Forms Authentication Redirect - Problem Redirecting out of HTTPS
    ... allowing an authentication cookie to be passed over an HTTP ... My login script goes into SSL just fine. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Basic password security question
    ... Look at the pages - they never post that form over HTTP - usually the login form posts to an HTTPS address.... ... You need SSL - and if you have it for the rest of your site, why not for you login page too? ... Developing More Secure Microsoft ASP.NET 2.0 Applications ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to allow external SSH access in Suse 9.1 Pro, Out of the box.
    ... I really, really hope you mean you have a normal login AND root, ... Also see if 'login@localhost' works where login is your normal user ... If you think it is to do with the numeric keyboard, ...
    (alt.os.linux.suse)