[cas-dev] Service URL in CAS 3.1
Scott Battaglia
scott.battaglia at gmail.com
Wed Nov 14 14:26:28 EST 2007
The casGenericSuccess page is only shown on generic success (i.e. no Service
is provided). It therefore has no access to the service ticket.
-Scott
On Nov 13, 2007 3:07 AM, Rodolfo Dias <dias.casserver at gmail.com> wrote:
> Hi Scott,
>
>
> The flow of the my screen is:
> 1 - I put in URL Browser the CAS client address, the Cas Client have the
> CAS Filter
> 2 - The CAS Filter redirect the user to OPENLASZLO Login Screen, see
> that Login Screen is a lzx file.
> 3 - While Login Screen is loaded
> 3.1 - Verify if the SERVICE attribute exist in URL, if true, their put
> in form field
> 3.2 - Get the flowExecutionKey
> 3.3 - Via AJAX send this information for login (Servlet) - CAS
> 4 - The response is LoginTicketId - Putting in form field
> 5 - The user put User id and Password Information and submit for MY
> SERVLET (This Servlet verify if the password is expired)
> 6 - In submit I send LoginTicketId (lt), User (username), Password
> (password), service (service)(the zimbra address) , warn , _eventId with
> "submit" value.
> 7 - MY SERVLET verify the expired, if not expired, I send this
> information for CAS SERVLET via
> request.getRequestDispatcher("login").forward(request,
> response);
>
> I mapped in lzx_views.properties that :
> casLoginGenericSuccessView.(class)=
> org.springframework.web.servlet.view.JstlView
>
> casLoginGenericSuccessView.url=/WEB-INF/view/jsp/lzx/protocol/2.0/casGenericSuccess.jsp
>
> My casGenericSuccess.jsp
> <%@ page session="false" %><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
> %><%@ taglib prefix="spring" uri=" http://www.springframework.org/tags"
> %><cas>
> <ticket>${serviceTicketId}</ticket>
> <otherTicket>${ticket}</otherTicket>
> <proxyTicket>${pgtIou}</proxyTicket>
> <ticketGrantingTicket>${ticketGrantingTicketId}</ticketGrantingTicket>
> <success>
> <authenticationSuccess><spring:message code="
> screen.success.success" /></authenticationSuccess>
> </success>
> </cas>
>
> The Cas return my casGenericSuccess.jsp and generate the cookie im my
> browser but don´t put serviceTicketId :(.
>
> Log information.
>
> <Request initiated by [ServletExternalContext at feef51 requestParameterMap =
> map['password' -> '1', 'service' -> 'http://localhost:8070/casClient/lixo.cas',
> 'action' -> 'verifyExpired', 'lt' ->
> '_cD4CAD9DE-3F1E-8D59-CD9F-60D88CFD0355_kD206FF0F-A79D-CBB3-EC87-9D6D1E6C245D',
> 'retypePassword' -> '', 'username' -> '1', 'warn' -> 'false', '_eventId' ->
> 'submit', 'newPassword' -> '']]>
> <Executing [Transition at 86ab98 on = [eventId = 'submit'], to =
> bindAndValidate] out of state 'viewLoginForm'>
> <Entering state 'bindAndValidate' of flow 'login-webflow'>
> <Executing [AnnotatedAction at 16b8a7a targetAction =
> org.jasig.cas.web.flow.AuthenticationViaFormAction at a6a14b, attributes =
> map[[empty]]] in state 'bindAndValidate' of flow 'login-webflow'>
> <Action 'AuthenticationViaFormAction' beginning execution>
> <For key 'bindAndValidate', returning cached value: public
> org.springframework.webflow.execution.Event
> org.springframework.webflow.action.FormAction.bindAndValidate(
> org.springframework.webflow.execution.RequestContext ) throws
> java.lang.Exception>
> <Binding allowed request parameters in map['password' -> '1', 'service' ->
> ' http://localhost:8070/casClient/lixo.cas ', 'action' -> 'verifyExpired',
> 'lt' ->
> '_cD4CAD9DE-3F1E-8D59-CD9F-60D88CFD0355_kD206FF0F-A79D-CBB3-EC87-9D6D1E6C245D',
> 'retypePassword' -> '', 'username' -> '1', 'warn' -> 'false', '_eventId' ->
> 'submit', 'newPassword' -> ''] to form object with name 'credentials',
> pre-bind formObject toString = null>
> <Action 'AuthenticationViaFormAction' completed execution; result is
> 'success'>
> <Signaling event 'success' in state 'bindAndValidate' of flow
> 'login-webflow'>
> <Executing [Transition at 1b12d63 on = [eventId = 'success'], to = submit]
> out of state 'bindAndValidate'>
> <Entering state 'submit' of flow 'login-webflow'>
> <Executing [AnnotatedAction at 11ae567 targetAction =
> org.jasig.cas.web.flow.AuthenticationViaFormAction at a6a14b, attributes =
> map['method' -> 'submit']] in state 'submit' of flow 'login-webflow'>
> <Action 'AuthenticationViaFormAction' beginning execution>
> <Attempting to create TicketGrantingTicket for 1>
> <Added ticket [TGT-3-LVGyLwEmeVIcPQzawePAUQytiEnKZrlbW57-50] to registry.>
> <Added cookie with name [CASPRIVACY] and value [true]>
> <Action 'AuthenticationViaFormAction' completed execution; result is
> 'success'>
> <Signaling event 'success' in state 'submit' of flow 'login-webflow'>
> <Executing [Transition at 9fab56 on = [eventId = 'success'], to =
> sendTicketGrantingTicket] out of state 'submit'>
> <Entering state 'sendTicketGrantingTicket' of flow 'login-webflow'>
> <Executing [AnnotatedAction at a9a7bb targetAction =
> org.jasig.cas.web.flow.SendTicketGrantingTicketAction at 42f3a9, attributes =
> map[[empty]]] in state 'sendTicketGrantingTicket' of flow 'login-webflow'>
> <Action 'SendTicketGrantingTicketAction' beginning execution>
> <Added cookie with name [CASTGC] and value
> [TGT-3-LVGyLwEmeVIcPQzawePAUQytiEnKZrlbW57-50]>
> <Action 'SendTicketGrantingTicketAction' completed execution; result is
> 'success'>
> <Signaling event 'success' in state 'sendTicketGrantingTicket' of flow
> 'login-webflow'>
> <Executing [Transition at 18b19ed on = [eventId = 'success'], to =
> serviceCheck] out of state 'sendTicketGrantingTicket'>
> <Entering state 'serviceCheck' of flow 'login-webflow'>
> <Executing [ Transition at 15351de on = *, to = viewGenericLoginSuccess] out
> of state 'serviceCheck'>
> <Entering state 'viewGenericLoginSuccess ' of flow 'login-webflow'>
>
>
> In login-webflow.xml
> <decision-state id="hasServiceCheck">
> <if test="${flowScope.service != null}" then="renewRequestCheck"
> else="viewGenericLoginSuccess"/>
>
> Well, the CAS don´t found flowScope.service :(.
>
>
> Thank you.
>
> :)
>
> OBS: Sorry, for my english.
>
>
> 2007/11/8, Scott Battaglia < scott.battaglia at gmail.com>:
>
> > The CAS web flow should be setting the service url. Why do you need to
> > do it manually?
> >
> > On Nov 8, 2007 2:20 AM, Rodolfo Dias < dias.casserver at gmail.com > wrote:
> >
> > > Hi,
> > >
> > > I was using CAS 3.0.5 with OPENLASZLO Login Screen where I put the
> > > service url into the request. But, when changing to CAS Version 3.1 I
> > > have problems. The service url comes from the FlowScope and i don´t know how
> > > to put this information there. How do I set information in the FlowScope?
> > >
> > > CAS 3.0.5
> > > AuthenticationViaFormaAction.java
> > >
> > > ..
> > > final String service = WebUtils.getRequestParameterAsString(request,
> > > WebConstants.SERVICE);
> > > ..
> > >
> > > Webutils.java
> > >
> > > //Recover Information the request
> > > public static String getRequestParameterAsString(
> > > final HttpServletRequest request, final String parameter) {
> > > return request.getParameter(parameter);
> > > }
> > >
> > >
> > > CAS 3.1
> > > AuthenticationViaFormAction.java
> > > ..
> > >
> > > service = WebUtils.getService(context);
> > >
> > > ..
> > >
> > > Webutils.java
> > > //Recover information the FlowScope
> > > public static final WebApplicationService getService(RequestContext
> > > context)
> > > {
> > > return
> > > (WebApplicationService)context.getFlowScope().get("service");
> > > }
> > >
> > >
> > > Rodolfo Dias
> > >
> > >
> > >
> > > _______________________________________________
> > > cas-dev mailing list
> > > cas-dev at tp.its.yale.edu
> > > http://tp.its.yale.edu/mailman/listinfo/cas-dev
> > >
> > >
> >
> >
> > --
> > -Scott Battaglia
> >
> > LinkedIn: http://www.linkedin.com/in/scottbattaglia
> > _______________________________________________
> > cas-dev mailing list
> > cas-dev at tp.its.yale.edu
> > http://tp.its.yale.edu/mailman/listinfo/cas-dev
> >
> >
>
> _______________________________________________
> cas-dev mailing list
> cas-dev at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas-dev
>
>
--
-Scott Battaglia
LinkedIn: http://www.linkedin.com/in/scottbattaglia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas-dev/attachments/20071114/ddacc3d1/attachment.html
More information about the cas-dev
mailing list