Re: Login problem
- From: "tdavisjr" <tdavisjr@xxxxxxxxx>
- Date: 6 Jun 2006 14:52:03 -0700
Well, You have to manually build the FormsAuthenticationTicket and then
redirect the user. Here is an article that you can look at.
http://blogs.msdn.com/tmeston/archive/2003/07/24/10505.aspx
Samuel Shulman wrote:
How can i use the Forms Authentication or Basic Authentication to perform a similar function
"Jeff Dillon" <jeffdillon@xxxxxxxxxxx> wrote in message news:%23y0Ft2YiGHA.1264@xxxxxxxxxxxxxxxxxxxxxxx
Use either Forms Authentication or Basic Authentication. You can't "Set" a user as authenticated.
"Samuel Shulman" <samuel.shulman@xxxxxxxxxxxx> wrote in message news:uuuJ9mYiGHA.3440@xxxxxxxxxxxxxxxxxxxxxxx
Let me try and clarify my question
If the user types in the url the Login.aspx file then enters the username and the password, clicks the login button and the form validates the values against values from the database
In case the values are correct and i want to send the user to another page, currently when i try doing it using the Response.Redirect method then if the destination page is in a protected folder it returns back to the login page because ASP.NET doesn't know that this user is authenticated
So all I need is another method that set the user as authenticated and then when i call the
Response.Redirect Method it will work
Of course if the user was automatically Redirected by the system to the login page then I can use the Web.Security.FormsAuthentication.RedirectFromLoginPage method
Thank you for your help
Samuel
"Peter Bromberg [C# MVP]" <pbromberg@xxxxxxxxxxxxxxxxxxx> wrote in message news:3B65DB89-2A8E-4A75-B611-6C64220BC86B@xxxxxxxxxxxxxxxx
> Samuel,
> If a user is logged in,
> the User property of the Page class will have a Name property with the
> username;
> you can access this from anywhere in your application.
>
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "Samuel Shulman" wrote:
>
>> Is there a method that will indicate the person who logged successfully is
>> Logged and therefore allowed to browse freely other then using the
>> 'Web.Security.FormsAuthentication.RedirectFromLoginPage' method
>>
>> thanks,
>> Samuel
>>
>>
>>
------=_NextPart_000_0218_01C689AE.FA5FB950
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 4950
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>How can i use the Forms Authentication or Basic
Authentication to perform a similar function</FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jeff Dillon" <<A
href="mailto:jeffdillon@xxxxxxxxxxx">jeffdillon@xxxxxxxxxxx</A>> wrote in
message <A
href="news:%23y0Ft2YiGHA.1264@xxxxxxxxxxxxxxxxxxxx">news:%23y0Ft2YiGHA.1264@xxxxxxxxxxxxxxxxxxxx</A>...</DIV>
<DIV><FONT face=Arial size=2>Use either Forms Authentication or Basic
Authentication. You can't "Set" a user as authenticated.</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Samuel Shulman" <<A
href="mailto:samuel.shulman@xxxxxxxxxxxx">samuel.shulman@xxxxxxxxxxxx</A>>
wrote in message <A
href="news:uuuJ9mYiGHA.3440@xxxxxxxxxxxxxxxxxxxx">news:uuuJ9mYiGHA.3440@xxxxxxxxxxxxxxxxxxxx</A>...</DIV>
<DIV><FONT face=Arial size=2>Let me try and clarify my question</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>If the user types in the url the Login.aspx
file then enters the username and the password, clicks the login button
and the form validates the values against values from the
database</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>In case the values are correct and i want to
send the user to another page, currently when i try doing it using the
Response.Redirect method then if the destination page is in a protected
folder it returns back to the login page because ASP.NET doesn't know that
this user is authenticated</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>So all I need is another method that set the
user as authenticated and then when i call the </FONT></DIV>
<DIV><FONT face=Arial size=2>Response.Redirect Method it will
work</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Of course if the user was automatically
Redirected by the system to the login page then I can use the <FONT
size=2>Web.Security.FormsAuthentication.RedirectFromLoginPage
method</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thank you for your help</FONT></DIV>
<DIV><FONT face=Arial size=2>Samuel</FONT></DIV>
<P><FONT face=Arial size=2></FONT> </P>
<P><FONT face=Arial size=2></FONT> </P>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>"Peter Bromberg [C# MVP]" <</FONT><A
href="mailto:pbromberg@xxxxxxxxxxxxxxxxxxx"><FONT face=Arial
size=2>pbromberg@xxxxxxxxxxxxxxxxxxx</FONT></A><FONT face=Arial size=2>>
wrote in message </FONT><A
href="news:3B65DB89-2A8E-4A75-B611-6C64220BC86B@xxxxxxxxxxxxx"><FONT
face=Arial
size=2>news:3B65DB89-2A8E-4A75-B611-6C64220BC86B@xxxxxxxxxxxxx</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>>
Samuel,<BR>> If a user is logged in, <BR>> the User property of the
Page class will have a Name property with the <BR>> username;<BR>> you
can access this from anywhere in your application.<BR>> <BR>>
Peter<BR>> <BR>> -- <BR>> Co-founder, Eggheadcafe.com developer
portal:<BR>> </FONT><A href="http://www.eggheadcafe.com"><FONT face=Arial
size=2>http://www.eggheadcafe.com</FONT></A><BR><FONT face=Arial size=2>>
UnBlog:<BR>> </FONT><A href="http://petesbloggerama.blogspot.com"><FONT
face=Arial size=2>http://petesbloggerama.blogspot.com</FONT></A><BR><FONT
face=Arial size=2>> <BR>> <BR>> <BR>> <BR>> "Samuel Shulman"
wrote:<BR>> <BR>>> Is there a method that will indicate the person
who logged successfully is <BR>>> Logged and therefore allowed to
browse freely other then using the <BR>>>
'Web.Security.FormsAuthentication.RedirectFromLoginPage' method<BR>>>
<BR>>> thanks,<BR>>> Samuel <BR>>> <BR>>>
<BR>>></FONT> </BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0218_01C689AE.FA5FB950--
.
- References:
- Login problem
- From: Samuel Shulman
- Login problem
- Prev by Date: GridView and multiple column sorting: is this a bug?
- Next by Date: Re: asp.net session vs. local variables in subs or functions - best pr
- Previous by thread: Login problem
- Next by thread: Re: Login problem
- Index(es):