Sharepoint / Infopath / HttpContext? - InfoPath Dev
in

InfoPath Dev

Sharepoint / Infopath / HttpContext?

Last post 11-09-2005 12:37 AM by Patrick Halstead. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 09-28-2005 01:45 PM

    • sk75
    • Not Ranked
    • Joined on 09-28-2005
    • USA
    • Posts 2

    Sharepoint / Infopath / HttpContext?

    Ok. I am having an issue that is really irritating me. I think I know the answer (if there is an answer, I think its more work than its worth), but I will ask anyways.

    I have a SharePoint Portal 2003, and Infopath 2003. To make a long story short, I would like to know within Infopath (managed code) what the currently logged in WEB user is. I can use system.environmetn.username, or a few other mechanisms, that will get me the domain account of the user that is logged into the machine. However, I would like to know the user that actually logged into SharePoint portal, as they may be a different user than is actually logged into the machine.

    I know some of you would ask, "why have AD and integrated security if a different user will login to the SPS site, than is logged into the machine". The answer is simple -- this is a proof of concept for a customer, and for simplicity I would like it if they could view the SPS site by logging in as multiple users to SPS, but just through one terminal service session.

    Everything that I have found points me to the direction that InfoPath really doesn't if a form is running under SPS, and if it does, there is really no way to grab the HTTPCONTEXT that launched the form, and thus the servevariables("LOGON_USER"), etc.

    The infopath form is launched from SPS as a form library.

    Any assistance would be great! Thanks!


    ...>SK<...
  • 09-28-2005 03:54 PM In reply to

    • sk75
    • Not Ranked
    • Joined on 09-28-2005
    • USA
    • Posts 2

    Re: Sharepoint / Infopath / HttpContext?

    As a follow up to this. I've seen the following code:

    try using:
    var wshShell = new ActiveXObject("Wscript.Shell");
    var wshEnv = wshShell.Environment("Process");
    var username = wshEnv.Item("UserName");

    My question is -- does that code give the windows login ID also, or does it give the ID used to login to IE/Sharepoint?


    ...>SK<...
  • 09-29-2005 08:35 PM In reply to

    Re: Sharepoint / Infopath / HttpContext?

    Windows login, and requires full trust. There should be other username commands for Http session. Please check out the .NET Framework.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 10-31-2005 09:48 PM In reply to

    Re: Sharepoint / Infopath / HttpContext?

    sk75, thank you asking this question, I am facing it too, unfortunately until now I ddn't find how to solve this problem, I just know the System.Environment.UserName cannot help. I have googled many times and without luck.
  • 10-31-2005 11:53 PM In reply to

    Re: Sharepoint / Infopath / HttpContext?

    Hi Alex,
    Check out our Active Directory Web service. That will solve your problem.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 11-01-2005 05:47 PM In reply to

    Re: Sharepoint / Infopath / HttpContext?

    Thanks,Patrick:
    I have gotten the AD service and met some trouble; Shanthi have so kindly helped me to solve this, but it still existed. The trouble is the AD service always returned the
    user's info of the machine where the AD service was installed. ( Shanthi know this)
    One more thing is just like sk75 said, we need to get the user info which is used to open the IP form instead of that logged the current machine.
    Sorry, I got a little confused and if I have made some misunderstanding, please forgive me.
    Thanks again.
  • 11-03-2005 10:37 AM In reply to

    Re: Sharepoint / Infopath / HttpContext?

    Hi Alex,
    We need to do a Live Meeting to look at this. If the user is in the domain and authenticated using Windows Integrated Authentication, then the logged in user should be the same as the user info used to open the IP form. Why would it be different? Can you explain what it is for you?

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 11-08-2005 07:06 PM In reply to

    Re: Sharepoint / Infopath / HttpContext?

    Hi, Patrick, sorry for the delay!
    I appreciate if another Live Meeting to be hold, Shanthi have make one meeting with me and the AD service still worked like I said upper.

    Regarding your upper questions, can I ask that the AD service can be only used just for all users are in one domain? for example, your have a SPS site and have a domain InfoDev.com, my machine is in another domain like Shinetech.com, then I open a IP form from (which have a connection to the AD service)your SPS site, at this period, I need input user account/password two times, one is when opening the SPS page, one is when I click Fill out this Form to open one new form, it is possible for me to use two different user account in the two time, is it right? the what the user info the AD service will return on the form? sorry if it reads difficult, my MSN: [email protected]

    By the way, the AD service runs will when I use the GetUserInfo method.

    Thank you!
  • 11-09-2005 12:37 AM In reply to

    Re: Sharepoint / Infopath / HttpContext?

    Hi Alex,

    We're incredibly busy right now. The AD Web service doesn't work well across domains. You could probably set up some trust relationship between the domains but you might still have issues.

    Glad to hear that the GetUserInfo method works well.

    Please post specific questions/issues to the Premium Downloads forum and we will respond within 24 hours.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.