UserID from sharepoint
-
I need the current logged in username from a sharepoint portal to be passed to ASPx .Net application which resides on a non-Sharepoint server. To elaborate, the .Net application is deployed on Windows 2003 non-sharepoint server. The URL of this application is provided as hyperlink on a sharepoint site for end user accessibility. I need the currently logged in sharepoint user id or actually the user email id, to be passed to the .Net application (maybe as query string or something). The user email id is required so that the application could send out a mail notification when it finishes the job. Is there anyway I can get the mail id in the application? Thanks in advance.
-K
-
I need the current logged in username from a sharepoint portal to be passed to ASPx .Net application which resides on a non-Sharepoint server. To elaborate, the .Net application is deployed on Windows 2003 non-sharepoint server. The URL of this application is provided as hyperlink on a sharepoint site for end user accessibility. I need the currently logged in sharepoint user id or actually the user email id, to be passed to the .Net application (maybe as query string or something). The user email id is required so that the application could send out a mail notification when it finishes the job. Is there anyway I can get the mail id in the application? Thanks in advance.
-K
You can use browse to the Email property of SPUser. To get SPUser, you can use SPUser user = SPContext.Current.User Riwut Libinuko Microsoft MVP | SharePoint Server | Singapore b: http://blog.libinuko.com c: http://ideasfreestsadm.codeplex.com
-
You can use browse to the Email property of SPUser. To get SPUser, you can use SPUser user = SPContext.Current.User Riwut Libinuko Microsoft MVP | SharePoint Server | Singapore b: http://blog.libinuko.com c: http://ideasfreestsadm.codeplex.com
Will I be able to get 'SPContext.Current.User' within an application that is not hosted on a Sharepoint server. Its just been linked to a sharepoint site as a hyperlink. When the user clicks on the link, the application would run in non-sharepoint context. I'll probably have to pass both sharepoint site URL and the current user-id to the application. But I dont have a clue how to do this. Any ideas? Thanks,
-K
-
Will I be able to get 'SPContext.Current.User' within an application that is not hosted on a Sharepoint server. Its just been linked to a sharepoint site as a hyperlink. When the user clicks on the link, the application would run in non-sharepoint context. I'll probably have to pass both sharepoint site URL and the current user-id to the application. But I dont have a clue how to do this. Any ideas? Thanks,
-K
The "other" application can not use SPContext.Current.User , since it doesn't relate with SharePoint. So the SharePoint application should pass the cred info to the next application. If you are using MOSS 2007 you can activate SSO (Single Sign On). Principle of SSO is to make SharePoint User -> Application User mapping. For more information on SSO, please refer here. http://msdn.microsoft.com/en-us/library/ms580316.aspx[^] If both application are in the same domain, you can use windows integrated authentication.
Riwut Libinuko Microsoft MVP | SharePoint Server | Singapore b: http://blog.libinuko.com c: http://ideasfreestsadm.codeplex.com