Passing project credentials to PSI

A

angus404

I have a VSTO add in that I have written for MS Project. I am using PSI calls
to get and save data to Project Server. My problem is with credentials. When
I make a web service call, I set the credentials to use
CredentialCache.DefaultCredentials. This appears to pass the users Windows
credentials to the web service.

I need to know how I can pass the users Project Server credentials instead.
I have some users that log into one Windows domain on their computer, then
when they open Project Professional and attach to Project Server, they log in
using a different domain.

How can I get the credentials that they are using to log into Project Server?

Thank you.
 
S

Stephen Sanderlin [MVP]

I don't believe that the project client exposes this anywhere. I think
that the best option would be for you to pop up a form asking them to
input their information.

--
Stephen Sanderlin, Project MVP
VP of Technology
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read our blog at: http://www.projectserverhelp.com

Learn | Connect | Grow @ The Microsoft Project Conference
Phoenix, AZ - September 14-17, 2009
 
H

Hans

You can retrieve the current username in Profiles.ActiveProfile.UserName
With this username, you can retrieve all the information you need for impersonation (using PSI to retrieve the user information or using a query to the Reporting DB).

I hope this helps.



Projectopolis



angus404 wrote:

I have a VSTO add in that I have written for MS Project. I am using PSI calls to get and save data to Project Server. My problem is with credentials. When I make a web service call, I set the credentials to use CredentialCache.DefaultCredentials. This appears to pass the users Windows credentials to the web service. I need to know how I can pass the users Project Server credentials instead. I have some users that log into one Windows domain on their computer, then when they open Project Professional and attach to Project Server, they log in using a different domain. How can I get the credentials that they are using to log into Project Server? Thank you.
 
S

Stephen Sanderlin [MVP]

I don't know if universal impersonation is the best approach here, since
he'll need to hard code credentials that would be used to connect to the
PSI in order to impersonate (or give every user the appropriate access).
IMHO, a better approach would be to gather the appropriate credentials
from user input and then connect to the PSI using a new
NetworkCredential object. At least this way he could encrypt the
credentials in-memory and he wouldn't need to hardcode anything.

--
Stephen Sanderlin, Project MVP
VP of Technology
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read our blog at: http://www.projectserverhelp.com

Learn | Connect | Grow @ The Microsoft Project Conference
Phoenix, AZ - September 14-17, 2009
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top