Just a quick follow-up.
I managed to sort this out. For some reason the Username / Password are set
on the Credential object automatically (maybe because I inherited from
UsernamePasswordCredential?) but I need to set my custom attribute myself.
This assumes you called the variable '*oneTimePassword*' in your JSP:
<view-state id="viewLoginForm" view="casLoginView" model="credential">
<binder>
<binding property="username" required="true"/>
<binding property="password" required="true"/>
<binding property="oneTimePassword" required="true"/>
<!--
<binding property="rememberMe" />
-->
</binder>
<on-entry>
*<evaluate
expression="credential.setOneTimePassword(requestParameters.oneTimePassword)"/>*
<set name="viewScope.commandName" value="'credential'"/>
<!--
<evaluate expression="samlMetadataUIParserAction" />
-->
</on-entry>
<transition on="submit" bind="true" validate="true" to="realSubmit"
/>
</view-state>
Thanks
On Wednesday, 20 July 2016 10:42:24 UTC+1, Jordan wrote:
>
> Hi,
>
> I have a (hopefully) simple question.
>
> I've created a Custom Authentication Handler & Credential Class to carry
> out authentication against a third party application, but to also ask the
> user for a One Time Password (for 2 Factor Authentication).
>
> So I'm looking to add a new field to the login page so the user provides:
>
> 1. Username
> 2. Password
> 3. One Time Password
>
> I've managed to edit the JSP to do this. The flow is getting to my
> Authentication Handler, where I'm getting an error that the One Time
> Password value is empty.
>
> I know my credential class is being loaded properly (I've checked the
> logs) and its definitely hitting my Custom Authentication handled (Again I
> get logs from it).
>
>
> So it looks like my custom parameter in the JSP isn't being passed to my
> Credential Class. I think this means I need to modify the login webflow to
> pass this new variable into the "credential" object which is passed
> onwards, but I'm not too sure how to do this.
>
>
> Can anyone help?
>
>
> XML Changes I've made so far:
>
> 1. Edited *deployerConfigContext.xml *to use my new Authentication
> Handler
> 2. Edited top line of *login-webflow.xml* to use my new Credential
> Class
>
> Thanks
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/a840b0a4-6295-4ec9-bb42-fa5d6274a646%40apereo.org.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.