Integrating CAS Proxying with Forms Authentication in ASP.Net 2.0
...
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) If User.Identity.IsAuthenticated Then If Not String.IsNullOrEmpty(CASAuthentication.ProxyAppResponse) Then Response.Write(String.Concat("Proxied App Response: ", CASAuthentication.ProxyAppResponse)) EndIf End If End Sub Protected Sub btnRunTest_Click(ByVal sender As Object,ByVal e As System.EventArgs) If Not CASAuthentication.InvokeCASProxy(ProxyAppUrl:="{url_to_your_CAS_Proxy_Application}", _ <html> |
The CAS callback Url (This would be the same application page specified in the pgtUrl attribute in the call to InvokeCASProxy method shown above) - This assumes that your main application (the CAS proxier) and callback Url are part of the same application so that they can share application specific variables. If the callback Url is NOT part of the same application, then you must handle storing/retrieving the pgtIou/pgtId pair yourself. (e.g. store them in an external database).
...
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<script runat="server"> Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Dim pgtIou As String= Request.QueryString.Get("pgtIou") DimpgtId As String= Request.QueryString.Get("pgtId") If Not String.IsNullOrEmpty(pgtIou)And _ Not String.IsNullOrEmpty(pgtId) Then 'We have a pgtIou/pgtId pair sent from CAS server End Sub <html> |
The CAS Proxy (This would be the same application specified in the ProxyAppUrl attribute in the call to InvokeCASProxy method shown above)
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
<script runat="server"> Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) If CASAuthentication.IsAuthenticated Then Dim proxyArgs As StringBuilder = New StringBuilder ' If Request.QueryString.Count > 0 Then Response.Write(proxyArgs.ToString) If Not String.IsNullOrEmpty(CASAuthentication.Proxies) Then End Sub <html> |