This should work... ICasPrincipal user = HttpContext.Current.User as ICasPrincipal;
Bill On Tue, Mar 23, 2010 at 9:45 AM, Dianne Asis <[email protected]> wrote: > What method can I use to get the cas principal when using > DotNetCasClient.CasAuthenticationModule instead of CasAlternateAuthModule? > > Before I was able to get the cas principal with SessionUtils.GetCasPrincipal > > //Using the alternate auth module > HttpSessionState session = SessionUtils.GetSession(); > ICasPrincipal sessionPrincipal = SessionUtils.GetCasPrincipal(session); > if (sessionPrincipal != null) > { > IAssertion sessionAssertion = sessionPrincipal.Assertion; > if (sessionAssertion != null) > { > if (sessionAssertion.Attributes.ContainsKey("memberOf")) > { > List<string> memberList = > sessionAssertion.Attributes["memberOf"].ToList(); > if (memberList.Contains("CN=grp Pepperdine > Group,CN=Users,DC=pepperdine,DC=ad,DC=pepperdine,DC=edu")) > { > .... > } > } > } > } > > > Now I switched to DotNetCasClient.CasAuthenticationModule, what's your > recommendation to get the cas principal? > > Thank you! > Dianne > -- > You are currently subscribed to [email protected] as: [email protected] > To unsubscribe, change settings or access archives, see > http://www.ja-sig.org/wiki/display/JSG/cas-user > -- You are currently subscribed to [email protected] as: [email protected] To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
