Hi there, 

I want to define a subflow in CAS' main login flow to reset user password. 
 The reason I want to define it as a subflow is because I do not want the 
URL to change in browser.  And, after user completes password change, and 
login successfully, he should be redirected to the original URL (in the 
application) that he was trying to go to in the first place. 

I noticed a problem, while the main flow shows theme UI correctly, the 
subflow always goes back to the default theme.  It turns out that "service" 
is a flowScope attribute, therefore, subflow does not see it.

    public static WebApplicationService getService(final RequestContext 
context) {
        return context != null ? (WebApplicationService) 
context.getFlowScope().get("service") : null;
    }


What I did is to manually pass flowScope.service from parent flow into the 
subflow.   See below.

Does that sound correct?  Any better suggestion?


in the main login parent flow

<subflow-state id="selfServiceResetPasswordSubFlow" 
subflow="login/resetpassword">
<input name="parentService" value="flowScope.service" 
type="org.jasig.cas.authentication.principal.WebApplicationService"/>
<transition on="passwordResetCompleted" to="generateLoginTicket"/>
</subflow-state>    

in the child change password flow


  <input name="parentService" 
type="org.jasig.cas.authentication.principal.WebApplicationService"/> 
<on-start>
                 <set name="flowScope.service" value="parentService" 
type="org.jasig.cas.authentication.principal.WebApplicationService"/>
</on-start>


Thanks,
Yan

-- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.

Reply via email to