Setting credentials

T

tshad

I have a logon page that my pages go to log a person on using
formsAuthentication.

Is there a way to jump directly to the logon page and have it set the
formsAuthentication cookie so that the next page (that would normally
require logging on - if not already done) would not jump to the logon page.

For example, I have a page with my submit function like so:
**********************************************************
sub submit_click( sender as Object, e as EventArgs )
if Not IsValid then
exit sub
end if
if request("ReturnURL") = Nothing then
server.transfer("resumeSubmit.aspx")
else
FormsAuthentication.RedirectFromLoginPage(txtEmail.text,false)
end if
end Sub
***********************************************************

I assume the FormsAuthentication.RedirectFromLoginPage normally sets the
cookie and jumps to the page that called it. Can I put a call just before
the server.transfer that does the same thing?

Thanks,

Tom.
 
C

Curt_C [MVP]

not sure what you mean..
If I understand you want to bypass the login? Uh...... doesn't that defeat
the purpose of using auth?
You can add pages in the web.config that ignore the auth mode.. would that
suffice?
 
T

tshad

Curt_C said:
not sure what you mean..
If I understand you want to bypass the login? Uh...... doesn't that defeat
the purpose of using auth?
You can add pages in the web.config that ignore the auth mode.. would that
suffice?

No. What I want to do is allow the user to log on from a link. He will go
into the logon page.

The next page he goes to will require him to logon again, since he didn't go
through the normal FormsAuthentication mechanism that sets the cookie. This
would be irritating. I want to be able to set the cookie manually, if this
is the case.

Tom
 
C

Curt_C [MVP]

just send them to the page, the system will catch them and send them to
login page and then use the ReturnUrl to bring em back in, no "extra" login
page needed then. I guess I'm not sure why you are trying to send them to a
different login page?

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


tshad said:
Curt_C said:
not sure what you mean..
If I understand you want to bypass the login? Uh...... doesn't that
defeat the purpose of using auth?
You can add pages in the web.config that ignore the auth mode.. would
that suffice?

No. What I want to do is allow the user to log on from a link. He will
go into the logon page.

The next page he goes to will require him to logon again, since he didn't
go through the normal FormsAuthentication mechanism that sets the cookie.
This would be irritating. I want to be able to set the cookie manually,
if this is the case.

Tom
 
T

tshad

There is only one login page.

But from my initial page (not logged on yet) I am allowing them to log in.
They press a link (logon.aspx) and go to that page. Now they are logged on.
But no cookie was generated as I don't use
FormsAuthentication.RedirectFromLoginPage as there is no redirect page to go
to.

Now, if they press a link to go to another page, they will go first to the
same logon page they just left from (because no cookie was generated).

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top