PDA

View Full Version : How to get information of sharepoint loged user??


Fenja
04-28-2009, 08:50 AM
Hi. Im trying whole day to solve one problem. So I would really apriciate if somenone knows the answer.

My flex 3 application is working upon Sharepoint services. So, I need to recognize which user is logged on SPS so user will not have to log on my application also.
I found some code for .NET webservice like this:

SPWeb web = SPControl.GetContextWeb(Context);
SPUser sUser = web.CurrentUser;
return sUser.LoginName;

Thing is that web will always be NULL?!?!

Then I found that I need to set credentials, but I dont understand how and where. Im not so good programmer, so can somebody give me full sulution for this? (webservice method + flex 3 code with credentials thing:))

Thanks.

Peter Cowling
04-28-2009, 01:19 PM
Single Sign On is probably what you will need to look at. Something like this http://wiki.threewill.com/display/is/2008/01/10/SharePoint+Connector+for+Confluence+-+How+We+Did+It gives the overview approach.

Fenja
04-30-2009, 07:54 AM
Single Sign On is probably what you will need to look at. Something like this http://wiki.threewill.com/display/is/2008/01/10/SharePoint+Connector+for+Confluence+-+How+We+Did+It gives the overview approach.

Tnx, but I really still dont understand how to get logged user from sharepoint service. Anybody solved this before?

Peter Cowling
04-30-2009, 09:27 AM
Note that Credentials.setCredentials is part of portal.singlesignon (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.portal.singlesignon.credentia ls.setcredentials.aspx)

I think you will need to build a connector, as per my earlier post, in order to get/set users.