0
votes

When an xpage is loaded into the browser, it checks to see if the the referrer contains the string "TranslateForm".

return facesContext.getExternalContext().getRequest().getHeader("Referer");

If it doesn't contain my string, it redirects to the URL "Home?RequestCert&SubmitCert&TranslateForm=CertSubmitTranslation" and then redirects to the xpage where it passes the initial test. I can easily get info from that Home form which captures info from the smart card (e.g. CommonName) and then pass it as a URL Parameter by appending the string "?CN=" + document.forms[0].CommonName.value

Then, I can obviously capture that appended value and do what I want with it as I process the xpage. What I want to do is capture that CommonName field and save it in the backend without using a URL Parameter. I don't want the user to be able to see it or look in the source for a hidden field.

1
What kind of SmartCard do you use and how does it make its values available in the browser. And yes - Frantisek points to the right approach: POSTstwissel
I don't know what you mean by "type of smart card", but the way I make values available in the browser is to use the form Submitted Certificate Translation form to parse data from the card. How and where do I change from POST to GET in the xpage?m benway
A browser is a piece of software, a smartcard a piece of hardware, somehow they need to communicate.That part is usually done by a hardware specific driver, hence my question: what card. When XPages shows a form it usually is POST, unless you created your own HTML form, then check the form element and set the attribute "method" to POSTstwissel
Users have an external card reader, it is built into their laptop, or built into their keyboard. "ActivClient" is the software/driver by the company ActivIdentity. All that works. I can get any info I want from the smartcard by using the Translation form. Right now, the only way I know to pass that info onto a new instance of an xpage is to go to use document.location = "/path/db.nsf/xpage.xsp&CN=" + document.forms[0].CommonName.value; Then I can grab whatever that value is on the xpage and save use it on processing, save it to the document in the backend, etc.m benway

1 Answers

0
votes

OK. What I did to solve this problem was to use the URL Parameter when launching the page:

document.location = "/path/db.nsf/xpage.xsp?CN=" + document.forms[0].CommonName.value;

AND I created a Counter field with a value of 0.

Then, in the BeforePageLoad event of the xpage, I ran a script to determine first if the Counter was at 0. If Counter was still at 0, then I tested if the URL had that parameter in it. If so, I wrote that value to the backend document, incremented the Counter, and saved it.

document1.replaceItemValue("CI", context.getUrlParameter("CI"));

Then reloaded the xpage/document in Edit mode without the URL parameter.