Site Server Login

Results 1 to 2 of 2

Thread: Site Server Login

  1. #1
    Join Date
    Dec 1969

    Default Site Server Login

    Ok guys, anyone clever?!<BR><BR>I am trying to log a user into Site Server automatically.<BR><BR>Basically this will all be incorporated into a DLL I am creating, but if I can get the b*stard working in ASP then I&#039;ll be a much happier boy.<BR><BR>I&#039;ve got the Site Server SDK (1.1), and have read various literature on the subject and nothing seems to solve my problem. Hopefully someone else will have tried something like this. If not, I&#039;ll try posting the same message in the COM forum.<BR><BR>According to the SDK, you can log a user into Site Server by using the Membership.VerifUsr object. Something along the lines of:<BR><BR>==== CODE START<BR><BR>Set objVU = Server.CreateObject("Membership.VerifUser.1")<BR>< BR>if objVU.VerifyPassword(UN, Pass) then<BR> <BR> &#039; The users credentials are OK.<BR> &#039; Give them the correct cookies etc.<BR> Response.Redirect(objVU.VerifyCredentials(UN, Pass, URL))<BR> Response.End<BR> <BR>end if<BR><BR>==== CODE END<BR><BR>However, if I do this then I end up with an error or "Method &#039;~&#039; of object &#039;~&#039; failed". It can verify the username and password, but won&#039;t seem to give them the cookie and forward on. I have tried this from within a DLL - is it worth doing from ASP? Might it need the Response/Request objects?<BR><BR>The other code I have found uses the "Membership.UserObjects" object. The code is almost exactly the same. This time, however, I receive a "Automation error". Code below.<BR><BR>(objResponse/objRequest are the relative ASP objects)<BR><BR>==== CODE STARTS<BR><BR> Set IVerifUsr = CreateObject("Membership.UserObjects.1")<BR> <BR> objResponse.Write ("&#060;script&#062;alert(&#039;test 2&#039;)&#060;/script&#062;")<BR> objResponse.Flush<BR> <BR> If IVerifUsr.VerifyPassword(UserName, Password) = 1 Then<BR> <BR> objResponse.Write ("&#060;script&#062;alert(&#039;test 3&#039;)&#060;/script&#062;")<BR> objResponse.Flush<BR> <BR> objSession("LoginName") = UserName<BR> returnedURL = IVerifUsr.VerifyCredentials(UserName, Password, URL)<BR> <BR> objResponse.Write ("&#060;script&#062;alert(&#039;test 4&#039;)&#060;/script&#062;")<BR> objResponse.Flush<BR> <BR> &#039;objResponse.Redirect (returnedURL)<BR> &#039;objResponse.end<BR> Exit Sub<BR> <BR><BR>==== CODE ENDS<BR><BR>Anyone got any ideas?! This is driving me up the wall.<BR><BR>Craig.

  2. #2
    Join Date
    Dec 1969

    Default RE: Site Server Login

    Not sure what&#039;s wrong with yours, but if it helps this is what my site does in ASP (not COM).<BR><BR>1. Set objVerifier=Server.CreateObject("Membership.verifu sr.1")<BR>2. objVerifier.VerifyPassword(strUsername,strPassword )<BR>3. Manually set Membership Cookies <BR>4. strRedirect = objVerifier.VerifyCredentials(strUsername, strPassword, strRedirect)<BR>5. if no errors Response.Redirect<BR><BR>I didn&#039;t write the code, so I&#039;m not always sure why the author did things the way they did. I have noticed before that cookies don&#039;t get written when they&#039;re supposed to (MemRightsChanged).<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts