Geeks With Blogs


The SharePoint Hillbilly Fewer Big Words... More Pretty Pictures...

We are using InfoPath with SharePoint more and more in our organization. Anyone who has dealt with InfoPath knows there’s a lot of nice functionality there, but it can also be a pain to work with.  I ran across a couple of issues I was finally able to resolve and wanted to spare you guys the same pain I went through.


1. Installing a Code Signing Certificate on an InfoPath form

If you want to really take advantage of what InfoPath can do (get user information, pre-populate fields with external data, etc.) you may find it necessary to use a Code Signing Certificate.  Here is what I had to go through:

Acquiring and Installing Code Signing Certificate

Here is a blog that details how to acquire and install a code signing certificate.  This is an old blog from 2005 and you only have to go through step 3. I purchased a Thawte certificate by the way. 

Setting Up InfoPath Form to Use Certificate

After the certificate is installed you will need to set the trust level on your InfoPath form and associate the Certificate with your InfoPath form. To do this:

  • From the design view of your InfoPath Form go to Tools->Form Options
  • Click on “Security and Trust”
  • Select your Security Level
  • Under the “Form Template Signature” click on “Select Certificate”
  • Click on the Certificate you just installed and click “OK”

There you go, that’s pretty much all there is to it.  What?  You mean your certificate was not in the list of certificates to choose from when you clicked “Select Certificate”?  I had the same thing happen to me.  I went through the steps of installing the certificate a second time and then I was able to successfully use the certificate.  I know of at least 2 other people who had the same experience, must be an unknown feature??

2. Determining FBA Username in InfoPath

If you are using FBA with your InfoPath form you have probably found out that the UserName function for InfoPath does not work.  You probably also realized  after Googling for a solution that there isn’t much information out there to help (unless I just used the wrong magical combination of keywords which is very possible).   So, how do you determine the FBA username in InfoPath?  It actually turned out to be fairly trivial using only one line of code:

  • From the design view of your InfoPath Form go to Tools->Programming->Loading Event
  • In whatever part of your code you need to access the username insert this line of code:
    • String name = (this.Application.User.LoginName);

    The returned LoginName is pre-pended with some information followed by a colon and the username.  Is this information accessible without writing code? That, I don’t know.  If someone does, please leave a comment.


    Well, there you have it.  Nothing glamorous or earth shattering, but hopefully it made your life a little bit easier.  As always, your feedback is appreciated.

    Posted on Friday, March 13, 2009 12:52 PM | Back to top

    Comments on this post: InfoPath – Some Need-To-Know Information

    # re: InfoPath – Some Need-To-Know Information
    Requesting Gravatar...
    Thanks for the tip how to sign a Form. But, I dont get a private key file (pvk) from Thawte. I get only a spc File. Do you have an idea what I do wrong?
    Left by Daniel on Apr 15, 2009 4:44 PM

    # re: InfoPath – Some Need-To-Know Information
    Requesting Gravatar...

    If I'm not mistaken (and I often am). At the moment you purchase the Thawte certificate you can download the pvk file, and then a few days later you get the spc file. Or did I get that backwards? Regardless, you don't get them at the same time.

    Hope that helps!
    Left by Mark on Apr 16, 2009 8:07 AM

    # re: InfoPath – Some Need-To-Know Information
    Requesting Gravatar...
    I have used InfoPath too many times but I implemented it few days back and found some problem like it always redirected to the default zone web application which is running on windows authentication rather than the extended web application which is running on FBA authentication.
    Do you have any idea or solution of this issue?
    Left by Rajiv Giri on Jun 16, 2009 5:40 AM

    # re: InfoPath – Some Need-To-Know Information
    Requesting Gravatar...
    Good information here! I was playing around a lot to cover this! Thanks!!!
    Left by FormBuilder on Feb 16, 2010 9:51 AM

    Your comment:
     (will show your gravatar)

    Copyright © Mark Rackley | Powered by: