Click here to Skip to main content
16,005,491 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: reduce this big code Pin
Sonia Gupta25-Jul-07 18:50
Sonia Gupta25-Jul-07 18:50 
AnswerRe: reduce this big code Pin
Brady Kelly27-Jul-07 3:56
Brady Kelly27-Jul-07 3:56 
GeneralRe: reduce this big code Pin
duo!@#29-Jul-07 16:04
duo!@#29-Jul-07 16:04 
GeneralRe: reduce this big code Pin
Brady Kelly29-Jul-07 21:43
Brady Kelly29-Jul-07 21:43 
QuestionDeployement of web application Issue Pin
padmaja_200625-Jul-07 17:35
padmaja_200625-Jul-07 17:35 
QuestionMenu Control Formatting Pin
dwreck_stg25-Jul-07 15:50
dwreck_stg25-Jul-07 15:50 
AnswerRe: Menu Control Formatting Pin
dwreck_stg26-Jul-07 3:23
dwreck_stg26-Jul-07 3:23 
QuestionSSO Help Pin
Ridge Howison25-Jul-07 12:59
Ridge Howison25-Jul-07 12:59 
Hello All,
Need your help with regards to SSO(Single Sign On). Lets say I have two websites A and B. After user logs on to A(login.aspx) user needs to go a say a default.aspx page and on Default.aspx, there is a button which on click should send the user to website B,(both websites are on the same domain..lets say a.abc.com and b.abc.com) as user is already logged on site A..it should directly send the user to welcome.aspx page on site B. Iam using form authentication. This is what i have in my web.config on both sites.
<authentication mode="Forms">
<forms name=".SSOAUTH" loginUrl="Login.aspx" protection="All" path="/" timeout="30"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<machineKey validationKey="1234567890" decryptionKey="9876543243" validation="SHA1"/>

On my site A login page, when user enters a login and password, i call a function and go against my DB and validate, if login and pwd match db, i return customerid and the code is as below:

Dim customerid As String = ValidateUser(txtUserName.Value, txtUserPass.Value)
If customerid <> "0" Then '--------Comment-if login is fine, customerid is never 0
Dim tkt As FormsAuthenticationTicket
Dim cookiestr As String
Dim ck As HttpCookie
tkt = New FormsAuthenticationTicket(1, txtUserName.Value, DateTime.Now, DateTime.Now.AddMinutes(30), True, "your custom data")
cookiestr = FormsAuthentication.Encrypt(tkt)
Session("FormData") = cookiestr '------Comment-saving in session for later use
Dim b As String = FormsAuthentication.FormsCookieName
Response.Cookies(b).Domain = .abc.com
Response.Cookies(b)("SiteA") = cookiestr
Response.Cookies(b).Expires = tkt.Expiration
Response.Cookies(b).Path = FormsAuthentication.FormsCookiePath
Response.Redirect("default.aspx")
Dim strRedirect As String
strRedirect = Request("ReturnURL")
If strRedirect <> "" Then
Response.Redirect(strRedirect, True)
Else
strRedirect = "Default.aspx"
Response.Redirect(strRedirect, True)
End If

Else
Response.Redirect("Login.aspx", True)
End If

My problem is it never redirects to Default.aspx on Site A... and from default.aspx on Site A..if i click a button..i need to it go to welcome.aspx on site B... for some weird reason though, it goes back to the login page..and further.. the cookie is set..its not reading it on site B. Please Help !! Any help is appreciated, where am i going wrong? code samples are much appreciated.

RH
QuestionDisplay text with label [modified] Pin
ASPnoob25-Jul-07 12:48
ASPnoob25-Jul-07 12:48 
AnswerRe: Display text with label Pin
Christian Graus25-Jul-07 13:05
protectorChristian Graus25-Jul-07 13:05 
GeneralRe: Display text with label [modified] Pin
ASPnoob25-Jul-07 14:03
ASPnoob25-Jul-07 14:03 
GeneralRe: Display text with label Pin
doWhileSomething25-Jul-07 16:37
doWhileSomething25-Jul-07 16:37 
QuestionDB2 problem? Pin
kidus125-Jul-07 11:15
kidus125-Jul-07 11:15 
QuestionProblem with IIS7 & ASP 3 (Two) Pin
mehrdadc4825-Jul-07 9:46
mehrdadc4825-Jul-07 9:46 
AnswerRe: Problem with IIS7 & ASP 3 (Two) Pin
Guffa25-Jul-07 10:20
Guffa25-Jul-07 10:20 
AnswerRe: Problem with IIS7 & ASP 3 (Two) Pin
Fred_Smith25-Jul-07 12:42
Fred_Smith25-Jul-07 12:42 
QuestionProblem with IIS7 & ASP 3 (one) Pin
mehrdadc4825-Jul-07 9:44
mehrdadc4825-Jul-07 9:44 
QuestionError : Attempted to read or write protected memory Pin
morteza5725-Jul-07 7:51
morteza5725-Jul-07 7:51 
QuestionEmail with multiple address Pin
Sam Heller25-Jul-07 7:37
Sam Heller25-Jul-07 7:37 
AnswerRe: Email with multiple address Pin
kubben25-Jul-07 8:23
kubben25-Jul-07 8:23 
QuestionHow to Populate a treeview with a file Pin
Edward LaPinski25-Jul-07 5:45
Edward LaPinski25-Jul-07 5:45 
AnswerRe: How to Populate a treeview with a file Pin
doWhileSomething25-Jul-07 11:19
doWhileSomething25-Jul-07 11:19 
Question2.0 Reference dataview control text in html??? Pin
munklefish25-Jul-07 5:19
munklefish25-Jul-07 5:19 
Questionregular expression for date Pin
rahul.net1125-Jul-07 5:19
rahul.net1125-Jul-07 5:19 
AnswerRe: regular expression for date Pin
Pete O'Hanlon25-Jul-07 10:22
mvePete O'Hanlon25-Jul-07 10:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.