Skip to content
This repository has been archived by the owner on Mar 20, 2019. It is now read-only.

Commit

Permalink
Improved documentation of classic ASP scenario slightly.
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Sep 5, 2010
1 parent 51f78b0 commit f235630
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 6 additions & 2 deletions samples/OpenIdRelyingPartyClassicAsp/default.asp
Expand Up @@ -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.&nbsp; 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.&nbsp; And the COM interfaces
Expand Down
13 changes: 8 additions & 5 deletions samples/OpenIdRelyingPartyClassicAsp/login.asp
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit f235630

Please sign in to comment.