Part of the problem here is I'm an application developer who sits in between 
the Data Center that manages the web servers and the Identity Management group 
that manages the CAS servers so I don't have access to a lot. Eric Pierce is in 
charge of our CAS implementation so he will have to pipe in about their set up 
and the log files on that side.

What I think is strange is the fact that there is no redirect loop for a user 
with attributes and but there is a redirect loop for a user without the 
expected attributes.  This could be because I don't know enough about how all 
this works. Also I write PHP apps using the PHP client and I can't repeat the 
issue there. But it is a different server and of course is set up different.

From: Scott [mailto:[email protected]]
Sent: Tuesday, November 05, 2013 2:44 PM
To: [email protected]
Subject: Re: [cas-dev] CAS .NET Client Redirect Loop and Attributes

I'm not too familiar with the Saml11TicketValidator implementation so I can't 
easily spot whether you could have an issue there by looking at the logs.  You 
may want to try adjusting the ticketTimeTolerance.  It may be worth 
experimenting with ticketValidatorName="Cas20".  I believe there were some 
patches to the CAS 2.0 validator to accept attributes.

You alluded to there being more than one server in the data center.  Do you 
have multiple web servers running the application that you're attempting to 
CASify?  If so, your situation gets slightly complicated.  From the looks of 
it, on line 53 it's 'Processing Proxy Callback request'.  Proxy authentication 
won't succeed without a proxyTicketManagerProvider registered and the default 
proxyTicketManager and serviceTicketManager don't support multiple web servers. 
 Processes that depend on those services will inevitably fail (proxy ticket 
creation, processing of inbound single-signout requests) unless you plug in 
your own custom implementation of IServiceTicketManager and IProxyTicketManager 
that persist to shared storage.  I see that you have removed the 
proxyTicketManagerProvider from web.config.  If line 53 means that it's trying 
to use that provider, that could explain why the ticket/cookie isn't getting 
generated.

If you aren't running your app on multiple servers, try to remove the 
serviceTicketManagerProvider="CacheServiceTicketManager" attribute.

Your serverName attributes shows http://.  I'm not sure offhand whether the CAS 
server has restrictions on connecting to http:// endpoints by default, but 
https:// is definitely recommended for security purposes, particularly when 
proxy tickets are in play.  If there is a restriction on this, the proxy ticket 
phase could be failing due to a missing callback from the CAS server.  I 
imagine the logs on the CAS server would indicate this situation.

The last resort troubleshooting approach on the app side would be to try would 
be to include the DotNetCasClient as a project reference rather than an 
assembly reference.  You could then set breakpoints in CasAuthentication or 
CasAuthenticationModule and see what's going on under the hood.

-Scott

On Tue, Nov 5, 2013 at 12:22 PM, Lehman, Jason 
<[email protected]<mailto:[email protected]>> wrote:
Worked with the Data Center and the certificate wasn't installed on every 
server but that has been resolved.  Still getting the redirect loop when there 
is successful authentication with a user who does not have attributes I am 
looking for but no redirect when user has attributes. I have attached the CAS 
client log file. In the log file are the two attempts. The login with a user 
without the attributes is the first part of the file going from line 1 to line 
244. The login with a user with the attributes starts at line 245.  Let me know 
if I need to adjust the web.config log configuration in any way to give more 
info.

From: Scott [mailto:[email protected]<mailto:[email protected]>]
Sent: Tuesday, November 05, 2013 10:15 AM

To: [email protected]<mailto:[email protected]>
Subject: Re: [cas-dev] CAS .NET Client Redirect Loop and Attributes

I just looked over your HTTP logs again and noticed a few things I must have 
missed the other day.

1) there is no redirect from the CAS server to your application with a service 
ticket parameter.  The CAS client expects the redirect back from CAS to have 
that.
2) there is no ASPXAUTH cookie getting sent back to the browser.  When the CAS 
client successfully validates the ticket, it uses standard Forms Authentication 
methods to create a FormsAuthenticationTicket and serializes it into a cookie 
(named ASPXAUTH by default I think)

Not sure why your logs don't show what looks like a successful authentication 
at the CAS server, which would explain why the FormsAuth ticket never gets 
created (the ST is validated and then a ticket/cookie is created).  If there 
were an ST coming back, but no ASPXAUTH cookie getting created, 99% of the time 
that would be because of a validation failure, which is generally bad 
configuration (wrong IP/host name) or an untrusted cert.

-Scott
On Mon, Nov 4, 2013 at 6:42 PM, Scott 
<[email protected]<mailto:[email protected]>> wrote:
Try turning on the tracing built in to the .NET client and post those logs 
back.  Assuming it's not a cookie problem, it should shed some more insight 
into why it's redirecting back out to the CAS server.

I might have mislead you with the IE/Chrome test.  I'm not 100% sure that would 
confirm it.  If your CAS server's SSL certificate is valid, not expired, and 
issued by a > $7/yr CA, this is probably barking up the wrong tree.  But if 
you're using one of the cheaper CA's, a self-signed cert, or an enterprise CA, 
this is a very common cause for redirect issues.

The comments in the example web.config show how to turn the tracing on.  Be 
sure to grant whatever identity your app pool is running as write permissions 
to the log file.
https://github.com/Jasig/dotnet-cas-client/blob/master/ExampleWebSite/web.config.sample

On Mon, Nov 4, 2013 at 12:29 PM, Lehman, Jason 
<[email protected]<mailto:[email protected]>> wrote:

1)      This doesn't seem to be the issue because I went to the server using IE 
and Chrome and I didn't receive a certificate error.

2)      Removing the path didn't stop the loop when using credentials without 
the attributes but login in with credentials with the attributes worked fine.

3)      As soon as I removed the serviceTicketManager and singleSignout="true" 
.NET thru up an error saying that was a required attribute for single signout. 
So instead I set singleSignout="false" and removed serviceTicketManager and the 
redirect still occurs when using credentials that don't have the attribute 
assigned but works fine for credentials that do have the attribute.

Anything else I should try?

Thanks for the help.



From: Scott [mailto:[email protected]<mailto:[email protected]>]
Sent: Monday, November 04, 2013 11:44 AM

To: [email protected]<mailto:[email protected]>
Subject: Re: [cas-dev] CAS .NET Client Redirect Loop and Attributes

Here are a few things to change to see if it eliminates the problem.  All three 
of them can cause redirect loops.  If you end up having to turn off a feature 
that you want to use in order to resolve the problem, post back to the list and 
I'll be happy to help you configure it properly.

1) Verify that the SSL certificate installed on your CAS server is trusted by 
Windows.  If IE or Chrome shows a security warning when you browse to your CAS 
server, the HTTP client connection that happens as part of the service ticket 
validation will also fail.  Similarly, if the CAS server doesn't trust the SSL 
certificate on your web server, proxy ticket support won't be possible.

2) Try removing the following from authentication/forms in web.config: 
path="/iUSF/".  Restricting the cookie path is a good idea when your web server 
is hosting more than 1 application and you want them to be isolated wrt. 
authentication, but if configured incorrectly, it will result in a redirect 
loop as well.

3) Try removing the following from casAuthentication in web.config: 
singleSignout="true", serviceTicketManager="CacheServiceTicketManager".  This 
is particularly important if you have more than one web server in your 
application.  CacheServiceTicketManager isn't suitable for multiple web 
servers.  When it's enabled, it stores information about the outstanding valid 
tickets in memory on the web server.  If the ticket was validated on one server 
but a subsequent request was handled by another, the validation would fail (the 
cookie details won't be in memory on that server and the cookie will be 
ignored).  You could end up in a redirect loop there as well.  To get around 
this, you could implement your own IServiceTicketManager with a 
sql/memcached/redis back-end that all your servers share access to.

-Scott

On Mon, Nov 4, 2013 at 10:38 AM, Lehman, Jason 
<[email protected]<mailto:[email protected]>> wrote:
I have attached the requested files.

-----Original Message-----
From: Marvin Addison 
[mailto:[email protected]<mailto:[email protected]>]
Sent: Monday, November 04, 2013 9:34 AM
To: [email protected]<mailto:[email protected]>
Subject: Re: [cas-dev] CAS .NET Client Redirect Loop and Attributes

> If I login with a user that doesn't have an attribute I'm expecting
> using the CAS .NET client I get into a redirect loop.

Please post your config and an HTTP header trace from an authentication 
attempt. That should help clarify whether it's a bug, configuration matter, or 
a mix of bad behavior in the face of configuration for which we might want to 
file an improvement issue.

M

--
You are currently subscribed to 
[email protected]<mailto:[email protected]> as: 
[email protected]<mailto:[email protected]> To unsubscribe, change settings or 
access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-dev


--
You are currently subscribed to 
[email protected]<mailto:[email protected]> as: 
[email protected]<mailto:[email protected]>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev


--
You are currently subscribed to 
[email protected]<mailto:[email protected]> as: 
[email protected]<mailto:[email protected]>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

--
You are currently subscribed to 
[email protected]<mailto:[email protected]> as: 
[email protected]<mailto:[email protected]>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev



--
You are currently subscribed to 
[email protected]<mailto:[email protected]> as: 
[email protected]<mailto:[email protected]>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

--
You are currently subscribed to 
[email protected]<mailto:[email protected]> as: 
[email protected]<mailto:[email protected]>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev


--
You are currently subscribed to 
[email protected]<mailto:[email protected]> as: 
[email protected]<mailto:[email protected]>
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-dev

-- 
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-dev

Reply via email to