You can not apply the encoding function to ANY form fields...Read below for the reasoning :
It is possible to smencode (or urlencode/b64encode) all the fields in the ssologin.fcc by just doing $$smecnode(variable_name)$$
Where ,
variable_name could be target,smquerydata,postpreservationdata or any custom fields.
However, to ensure that the variable is properly decoded after the POST , you will need to do the corresponding decoding for that variable using
@variable=%decode function(variable)% synatx at the top of your fcc file.
Now, limitation here is that you can NOT define any variable here. Only certain special variable are allowed here.
These are called directives.
In other words, there are only limited set of directives which are allowed for special processing and they are :
https://docops.ca.com/ca-single-sign-on-12-52-sp1/en/configuring/policy-server-configuration/authentication-schemes/configure-html-forms-authentication
-username
-password
-target
-smheaders
-smerrorpage
-smretries
-smpasswordfcc
-smusrmsg
-smauthreason
-smsavecreds
-smsave
-save
-smtransient
-smagentname
-smlogout
So , as you can see , you cannot encode "postpreservationdata" field or any other custom fields, because they are NOT a valid directive and as such they won't be decoded even if you specify following at the top of your fcc :
@postpreservationdata=%smdecode(postpreservationdata)%
This will eventually cause the postpreservationdata to be unable to decode after the POST is complete.