Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CASProxy.aspx - The CAS Proxy (This would be the same application specified in the ProxyAppUrl attribute in the call to InvokeCASProxy method shown above)

<%@ Page
Code Block
htmlhtml
Panel
borderColor#cccccc
bgColor#ffffff
titleBGColor#eeeeee
titleCASProxy.aspx
borderStyledashed

Span
stylebackground-color:yellow
idhl

<%

@ Page Language="VB"

%> <script

Span
stylebackground-color:yellow
idhl

%>

<script runat="server">

Protected Sub


    Protected Sub Page_Load(ByVal

sender

As

Object,

ByVal

e

As

System.EventArgs)

If

        If CASAuthentication.IsAuthenticated

Then

Then
            Response.Write("Welcome

"

&

CASAuthentication.CalNetID

&

",

you

have

been

successfully

authenticated

with

CAS!")


            Response.Write("<BR>")

Dim proxyArgs As StringBuilder = New StringBuilder Dim proxyArgKey As String = String.Empty ' 'Since this is the proxy application, we will check it's arguments it was sent 'Normally we would know if the arguments were sent in the query string or Form post 'but for the purposes of this example, we will check both ' If Request.QueryString.Count > 0 Then 'get arguments from querystring object For Each proxyArgKey In Request.QueryString

            Dim proxyArgs As StringBuilder = New StringBuilder
            Dim proxyArgKey As String= String.Empty

'
'Since this is the proxy application, we will check it's arguments it was sent
'Normally we would know if the arguments were sent in the query string or Form post
'but for the purposes of this example, we will check both
'

            If Request.QueryString.Count > 0 Then
                'get arguments from querystring object
                For Each proxyArgKey In Request.QueryString
                    proxyArgs.AppendFormat("{0}={1}

(query

string)<br>",

proxyArgKey,

Request.QueryString.Get(proxyArgKey))

Next Else 'get arguments from form object For Each proxyArgKey In Request.Form


                Next
            Else
                'get arguments from form object
                For Each proxyArgKey In Request.Form
                    proxyArgs.AppendFormat("{0}={1}

(form

post)<br>",

proxyArgKey,

Request.Form.Get(proxyArgKey))

Next End If


                Next
            EndIf

            Response.Write(proxyArgs.ToString)


            Response.Write("<BR>")

If Not

            If Not String.IsNullOrEmpty(CASAuthentication.Proxies)

Then Response

Then
               Response.Write(CASAuthentication.Proxies)


               Response.Write("<BR>")

End If End If End Sub </script> <html> <head> <title>Test CAS Proxied Application</title> </head> <body> <a


            End If
        End If

    End Sub
</script>

<html>
<head>
    <title>Test CAS Proxied Application</title>
</head>
<body>
    <a href="LogOut.aspx"

>Log

>Log out

of

CAS</a> </body> </html>

CAS</a>
</body>
</html>