Thanks.  This worked perfectly.

-----Original Message-----
From: Gasper, John [mailto:jgas...@ewu.edu] 
Sent: Wednesday, December 07, 2011 12:14 PM
To: cas-dev@lists.jasig.org
Subject: RE: [cas-dev] Is there a .NET Client equivalent to 
phpCAS::getAttributes?

Jason,

The CasPrincipal object 's Assertion property has the SAML11 attributes.

Here's a snippet of code I use to swap out the CasPrinicipal/Cas NetID for a 
new principal built with a CAS attribute containing the employee/student id 
(the application expects the username to be the employee/student id):
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As 
EventArgs)
            ' Fires upon attempting to authenticate the user, this replaces the 
NetID with the EWUID that the app desires.
            If TypeOf User Is DotNetCasClient.Security.CasPrincipal Then        
   
                Dim ident as String = DirectCast(User, 
DotNetCasClient.Security.CasPrincipal).Assertion.Attributes("Ewuid")(0) 
                Context.User = new 
System.Security.Principal.GenericPrincipal(new 
System.Security.Principal.GenericIdentity(ident, "Ja-sig CAS Translated"), 
nothing)
            End If
    End Sub

The line of code you want is:
Dim ident as String = DirectCast(User, 
DotNetCasClient.Security.CasPrincipal).Assertion.Attributes("Ewuid")(0)

I hope that helps.

John Gasper
Identity & Integration Architect    EWU Information Technology
202 Huston Hall    Cheney, WA 99004
509.359.6419    jgas...@ewu.edu    www.ewu.edu




-----Original Message-----
From: Jason [mailto:jleh...@usf.edu]
Sent: Wednesday, December 07, 2011 6:44 AM
To: cas-dev@lists.jasig.org
Subject: [cas-dev] Is there a .NET Client equivalent to phpCAS::getAttributes?

I'm switching from php to .NET (and new to .NET) but is there a getAttributes 
equivalent?  I'm connected and I have the username but just curious how to get 
the released attributes by the provider.  Thanks for any help.
--
You are currently subscribed to cas-dev@lists.jasig.org as: jgas...@ewu.edu To 
unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev


--
You are currently subscribed to cas-dev@lists.jasig.org as: jleh...@usf.edu To 
unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

-- 
You are currently subscribed to cas-dev@lists.jasig.org as: 
arch...@mail-archive.com
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

Reply via email to