Checkbox on login page

Jim Fox fox at washington.edu
Thu Jun 8 12:20:01 EDT 2017


> I would like to add a check box to the idp login page ("I am working on a public computer"). The value of the checkbox
> (publiccomputer=[yes|no]) should get delivered to a service provider as a saml attribute.

You can do this to get hold of the checkbox value.

1) add the checkbox to the login form.

2) make a local copy of the password flow

3) add to your new flow.xml

     <action-state id="PreValidateUsernamePassword">
         <evaluate expression="flowRequestContext.getExternalContext().getNativeRequest()" result="flowScope.request" />
         <evaluate expression="flowScope.request.getParameter('publiccomputer')" result="requestScope.publiccomputer" />
         <evaluate expression="'proceed'" />
         <transition on="proceed" to="ValidateUsernamePassword" />
     </action-state>

4) Change the transition of 'ExtractUsernamePasswordFromFormRequest' to your 'PreValidateUsernamePassword'


That will give you the checkbox in a Spring WebFlow variable.  Don't know how you would then get it to a response attribute. Possibly you would need the conversationScope instead of requestScope.

Jim




More information about the users mailing list