> Any thoughts, Scott/Andrew?

I think it is best to use a client library for CAS integration.

> may need to add manual login to my webapp (meaning, not use the web.xml method or jsp tag library)

Why?  Assuming this is a Java web application, in what way is the CASFilter not sufficient?


> Basically, I want to make sure that whether the user goes to Page2 via Page1
> or directly, he is always going to be  authenticated.
> So, here is the logic that EVERY page executes-

[
Get ticket parameter
if ticket is null
   redirect to CAS login with renew=FALSE
Get ticket parameter
validate ticket
if user is authenticated
   display page
else
   redirect to CAS with renew=TRUE
]

You can look at the CASFilter for an outline of the desired logic here.

If you want to "bounce the user off of CAS" on every page click, this logic at the top of every page does it:

[
Get ticket parameter
if ticket is null
   redirect to CAS login with service={the page's URL}
validate ticket
if ticket validates
   display page appropriate to user authenticated by ticket
else
   redirect to CAS with service={the page's URL}&renew=true
]

If you don't want to use CAS's "renew" feature, you needn't specify renew=false, you can just omit the parameter.  The renew=true on that last redirect is useful for avoiding an infinite loop of redirecting back and forth between CAS and your application with CAS issuing tickets that then fail to validate, e.g. because your app is misconfigured as to validation URL.

You don't need to use CAS's "renew" feature to get a valid ticket, you only need to use it if you want to ensure that the user strongly authenticated (typically, typed in password) in order to access your page.  Using the "renew" feature in an application that gets and validates a new ticket on every page access yields an annoying user experience of constantly having to type the password.

CAS is an authenticated session broker, not an authenticated session manager.  Which is to say, CAS is the trusted intermediary whereby a user establishes an authenticated session with your application.  Your application is then intended to carry forward that authenticated session, managing it however it needs to be managed.  Your application is intended to recognize the authenticated user on subsequent requests after initial CAS authentication is established.

If you follow this practice, then the logic is more like:

[
Check for authenticated username in the session
   If username found
      display page appropriate to authenticated user
Get ticket parameter
if ticket is null
   redirect to CAS login with service={the page's URL}
validate ticket
if ticket validates
   store authenticated username into session
   display page appropriate to user authenticated by ticket
else
   redirect to CAS with service={the page's URL}&renew=true
]


> If there is no ticket and I redirect to CAS with renew=false, I will be REQUIRED to login- is that a correct statement?

Probably not the way you mean.

If you redirect to CAS and do not specify renew=true, CAS will look for a secure SSO session cookie ("ticket granting ticket") in th web browser request. If it is present and valid, CAS will issue a service ticket on that basis and redirect back to your application without displaying a login user experience.  If you specify renew=true on the request, then CAS will present the login form regardless of the presence of a valid ticket granting ticket.

Andrew
http://support.unicon.net/


webzo wrote:
Any thoughts, Scott/Andrew?

----- Original Message ----
From: webzo <[EMAIL PROTECTED]>
To: Yale CAS mailing list <[email protected]>
Sent: Thursday, April 5, 2007 10:17:13 AM
Subject: Re: Questions about manual login process..

Hmm, check the session for what? Is there a way to check if the session is still valid? If there is, then my logic would become-
Check if session is valid
if valid
   display page
else
   redirect to CAS login with renew=TRUE
   Get ticket parameter
   validate ticket
   if user is authenticated
      display page
   else
      redirect to CAS again with renew=TRUE

Thanks.


----- Original Message ----
From: Scott Battaglia <[EMAIL PROTECTED]>
To: Yale CAS mailing list <[email protected]>
Sent: Wednesday, April 4, 2007 7:54:17 PM
Subject: Re: Questions about manual login process..

Is there a reason you're not checking the session at all?

-Scott

On 3/29/07, webzo <[EMAIL PROTECTED] > wrote:
I may need to add manual login to my webapp (meaning, not use the web.xml method or jsp tag library). Just to be sure that I am covering all bases, I have described the logic I have used below. Can someone confirm that it sounds ok?
Say there are 2 pages, Page1 and Page2. There is a link to Page2 from Page1. Basically, I want to make sure that whether the user goes to Page2 via Page1 or directly, he is always going to be  authenticated. So, here is the logic that EVERY page executes-

Get ticket parameter
if ticket is null
   redirect to CAS login with renew=FALSE
Get ticket parameter
validate ticket
if user is authenticated
   display page
else
   redirect to CAS with renew=TRUE


I am mostly concerned about passing renew=FALSE the first time because that makes CAS reuse a  previous SSO session. I think I need to do this because if the user gets to Page2 from Page1, then ticket will be null. But I should not require the user to sign in again because he just did to enter Page1.

If there is no ticket and I redirect to CAS with renew=false, I will be REQUIRED to login- is that a correct statement?

Thanks for your time.


Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.

_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas




--
-Scott Battaglia

LinkedIn: http://www.linkedin.com/in/scottbattaglia
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas



Don't get soaked. Take a quick peek at the forecast
with theYahoo! Search weather shortcut.
_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas



Get your own web address.
Have a HUGE year through Yahoo! Small Business.

_______________________________________________ Yale CAS mailing list [email protected] http://tp.its.yale.edu/mailman/listinfo/cas



_______________________________________________
Yale CAS mailing list
[email protected]
http://tp.its.yale.edu/mailman/listinfo/cas

Reply via email to