diff options
-rw-r--r-- | samples/OpenIdRelyingPartyClassicAsp/default.asp | 8 | ||||
-rw-r--r-- | samples/OpenIdRelyingPartyClassicAsp/login.asp | 13 |
2 files changed, 14 insertions, 7 deletions
diff --git a/samples/OpenIdRelyingPartyClassicAsp/default.asp b/samples/OpenIdRelyingPartyClassicAsp/default.asp index cc2bd57..ddb8dc0 100644 --- a/samples/OpenIdRelyingPartyClassicAsp/default.asp +++ b/samples/OpenIdRelyingPartyClassicAsp/default.asp @@ -25,10 +25,14 @@ assembly is found.</li> <li>Register DotNetOpenAuth as a COM server:<br /> <span class="command">%windir%\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe - /tlb DotNetOpenAuth.dll</span></li> + /tlb DotNetOpenAuth.dll</span><br /> + Note that you may need to copy System.Web.Mvc.dll into the same directory as dotnetopenauth.dll + if it is not already in your GAC.</li> <li>Install DotNetOpenAuth into the GAC. The gacutil.exe tool may be in an SDK directory, which will be in your path if you opened a Visual Studio Command Prompt.<br /> - <span class="command">gacutil.exe /i DotNetOpenAuth.dll</span></li> + <span class="command">gacutil.exe /i DotNetOpenAuth.dll</span><br /> + Be sure to use a gacutil.exe that comes from a .NET 2.0-3.5 directory (not .NET 1.x). + </li> </ol> <p>Another thing to be aware of is that with classic ASP there is no Web.config file in which to customize DotNetOpenAuth behavior. And the COM interfaces diff --git a/samples/OpenIdRelyingPartyClassicAsp/login.asp b/samples/OpenIdRelyingPartyClassicAsp/login.asp index 18c4d4f..90112f9 100644 --- a/samples/OpenIdRelyingPartyClassicAsp/login.asp +++ b/samples/OpenIdRelyingPartyClassicAsp/login.asp @@ -13,17 +13,19 @@ <h2>Login Page</h2> <% dim realm, thisPageUrl, requestUrl, dnoi, authentication - realm = "http://" + Request.ServerVariables("HTTP_HOST") + "/classicaspdnoi/" - thisPageUrl = "http://" + Request.ServerVariables("HTTP_HOST") + Request.ServerVariables("URL") - requestUrl = "http://" + Request.ServerVariables("HTTP_HOST") + Request.ServerVariables("HTTP_URL") + realm = "http://" + Request.ServerVariables("HTTP_HOST") + "/classicaspdnoi/" ' change this to be the home page of your web site, without the filename. + requestUrl = "http://" + Request.ServerVariables("HTTP_HOST") + Request.ServerVariables("HTTP_URL") ' this is the full URL of the current incoming request. Set dnoi = server.CreateObject("DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty") On Error Resume Next + ' Since this page both starts the OpenID authentication flow and receives the response, we don't + ' yet know whether this particular request is already in the response phase. Check that now. Set authentication = dnoi.ProcessAuthentication(requestUrl, Request.Form) If Err.number <> 0 Then + ' Oops, report something that went wrong. Response.Write "<p>" + Server.HTMLEncode(Err.Description) + "</p>" End If On Error Goto 0 - if Not authentication Is Nothing then + if Not authentication Is Nothing then ' if this WAS an OpenID response coming in... If authentication.Successful Then Session("ClaimedIdentifier") = authentication.ClaimedIdentifier If Not authentication.ClaimsResponse Is Nothing Then @@ -35,9 +37,10 @@ else Response.Write "Authentication failed: " + authentication.ExceptionMessage end if - elseif Request.Form("openid_identifier") <> "" then + elseif Request.Form("openid_identifier") <> "" then ' if the user is only now starting the authentication flow... dim redirectUrl On Error Resume Next + thisPageUrl = "http://" + Request.ServerVariables("HTTP_HOST") + Request.ServerVariables("URL") ' this is the URL that will receive the response from the OpenID Provider. ' redirectUrl = dnoi.CreateRequest(Request.Form("openid_identifier"), realm, thisPageUrl) redirectUrl = dnoi.CreateRequestWithSimpleRegistration(Request.Form("openid_identifier"), realm, thisPageUrl, "nickname,email", "fullname") If Err.number <> 0 Then |