Ask a Question related to ASP.NET Security, Design and Development.
-
Pascal.Landry #1
problem with SetAuthCookie
I have a web application that authenticate users and give them access to all
other web applications of the company.
They first get access to default.aspx wich ask them for a user name and a
password. It then authenticate them via a SQL Server, create a authentication
cookie and then create a list of applications they have access.
This list is made of simple <a> tags and open new browsers so that visitors
don't need to relogin all the time.
All <a> tags leed to another page named LoadApp.aspx witch create a token
and then redirect the response to the application the user asked for with the
token in parameters.
Child applications then read the token, check if it is ok and delete it if
it is correct and create a authentication cookie for the child application.
When I access my general application by localhost, all the process is
working but if I access it from [url]http://machinename/application[/url] I can only get
one application.
I can authenticate on the primary application, I get the list and I can
access the first application that I select from the list. But when I try to
click on a second one, the page that shows the new browser is default.aspx of
the primary application with a ReturnURL argument as if I was not
authenticated.
Is that clear ? Anyone have a hint about it ?
Thanks !
Pascal.Landry Guest
-
contribute problem - access denied file may not existpermission problem
Recieving the following error message - "access denied file may not exist , or there could be a permission problem" this happened this morning ,... -
SetAuthCookie problem
I have a login page which with the following code: FormsAuthentication.SetAuthCookie(UserID, False) '''''For testing''' ... -
Problem playing Quicktime thru .DCR embedded in HTML - pathreferencing problem?
Greetings earthlings and Director heads. Here's the problem: created an HTML file containing shockwave (dcr) movie that calls quicktime movies in... -
Uploading problem = weird warning (was: access denied problem.....)
Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the... -
Problem with Apache Web Server config file and PHP (please give advice on what problem may be me)
HI: Can anyone refer me to someone that can help with the problem below. I installed Apache Web Server on my laptop which has Windows XP. I... -
Pascal.Landry #2
problem with SetAuthCookie
Is there a problem with SethAuthCookie if I open more than one new window
from my application ?
After being authenticated, I clic a web link that open new browser with
another application in it. If I clic on another link it seems that the
authentication is not made because the second new browser shows me the login
page again...
I really need help with this !
Pascal.Landry Guest
-
David Colliver #3
Problem with setauthcookie
Hi all,
I am having a problem with setting the auth cookie.
I have a username/password box on a page. In my button
event, I am checking a database with the
username/password pair and if I get a row returned, then
I do...
FormsAuthentication.SetAuthCookie(UserNameBox.Text , true);
then do a little bit on my page, such as switching off
panels and switching others on.
Now, on one of the panels that I switch on, I have
linkbuttons which post the page back. I am checking...
if (User.Identity.IsAuthenticated) to do other
operations. This is in my page_load, but IsAuthenticated
is returning false.
I know of no reason. Can anybody help?
My code...
private void Page_Load(object sender,
System.EventArgs e)
{
// Put user code to initialize
the page here
//CheckLogin();
if (User.Identity.IsAuthenticated)
{
TabListPanel.Visible =
true;
Trace.Warn("Auth",
DateTime.Now.ToString());
}
else
{
LoginPanel.Visible = true;
}
}
private void LoginButton_Click(object
sender, System.EventArgs e)
{
CheckLogin();
}
private void CheckLogin()
{
try
{
sqlConn.Open();
SqlDataAdapter cmd;
if
(User.Identity.IsAuthenticated)
{
cmd = new
SqlDataAdapter(MyNoneAuthSqlStatement, sqlConn);
}
else
{
cmd = new
SqlDataAdapter(MyAuthSqlStatement, sqlConn);
}
DataSet Login = new
DataSet();
cmd.Fill
(Login, "UserDetails");
if (Login.Tables
["UserDetails"].Rows.Count > 0)
{
// Write the
authentication cookie.
FormsAuthentication.SetAuthCookie
(LoginEmailTextBox.Text, true);
// Remove login
panel, show links (TAB) panel.
LoginPanel.Visible = false;
TabListPanel.Visible = true;
}
}
finally
{
sqlConn.Close();
}
}
This is in my web.config... I have to be careful in here
as this may have issues elsewhere on the site.
<authentication mode="Forms">
<forms loginUrl="MyLogonPage.aspx"
name="adAuthCookie" timeout="60" path="/NQT">
</forms>
</authentication>
Thanks for any assistance.
Best regards,
Dave Colliver.
[url]http://www.SheffieldFOCUS.com[/url]
~~
[url]http://www.FOCUSPortals.com[/url] - portal franchises available
David Colliver Guest
-
Brock Allen #4
Re: Problem with setauthcookie
> if (User.Identity.IsAuthenticated) to do other operations. This is in
That's because for this request the user wasn't authenticated when they came> my page_load, but IsAuthenticated is returning false.
in.
-Brock
DevelopMentor
[url]http://staff.develop.com/ballen[/url]
Brock Allen Guest
-
Re: Problem with setauthcookie
Hi Brock,
Thanks for answering this Q and the one regarding my
usercontrols on the other group.
Granted, the form at initial request won't be
authenticated. This is where I put in a login form. Once
the form has been submitted, then I create an authcookie
in the button submit event.
When I return to the page, I would expect the cookie to
be read which I am assuming would make
User.Identity.IsAuthenticated = true.
Am I missing something?
Thanks.
Dave Colliver.
[url]http://www.ChesterFOCUS.com[/url]
operations. This is in>-----Original Message----->> if (User.Identity.IsAuthenticated) to do otherauthenticated when they came>>> my page_load, but IsAuthenticated is returning false.
>That's because for this request the user wasn't>in.
>
>-Brock
>DevelopMentor
>[url]http://staff.develop.com/ballen[/url]
>
>
>
>
>.
>Guest
-
Dominick Baier [DevelopMentor] #6
Re: Problem with setauthcookie
Hello John,
i have a sample app on my blog which shows you how to correctly do this:
[url]http://www.leastprivilege.com/PermaLink.aspx?guid=b0e51388-71d1-4a6f-98d0-bc8cfbec4c3a[/url]
HTH
---------------------------------------
Dominick Baier - DevelopMentor
[url]http://www.leastprivilege.com[/url]
> Hi Brock,
>
> Thanks for answering this Q and the one regarding my usercontrols on
> the other group.
>
> Granted, the form at initial request won't be authenticated. This is
> where I put in a login form. Once the form has been submitted, then I
> create an authcookie in the button submit event.
>
> When I return to the page, I would expect the cookie to be read which
> I am assuming would make User.Identity.IsAuthenticated = true.
>
> Am I missing something?
>
> Thanks.
> Dave Colliver.
> [url]http://www.ChesterFOCUS.com[/url]> operations. This is in>> -----Original Message-----
>>>>> if (User.Identity.IsAuthenticated) to do other
>>>
>> authenticated when they came>> That's because for this request the user wasn't>>> my page_load, but IsAuthenticated is returning false.
>>>
>>
>>> in.
>>
>> -Brock
>> DevelopMentor
>> [url]http://staff.develop.com/ballen[/url]
>> .
>>
Dominick Baier [DevelopMentor] Guest



Reply With Quote

