Disadvantages of hard coding credentials? What's the resolution?
Posted
by SeeBees
on Stack Overflow
See other posts from Stack Overflow
or by SeeBees
Published on 2010-04-20T22:10:06Z
Indexed on
2010/04/20
22:13 UTC
Read the original article
Hit count: 216
I am building a Sharepoint web part that will be used by all users. The web part connects to a web service which needs credentials with higher privileges than common users. I hard coded credentials in the web part's code.
query.Credentials = new System.Net.NetworkCredential("username", "password", "domain");
query
is an instance of the web service class
This may not be a good approach. In regard with security, source code of the web apart is available to people who are not allowed to see the credential. This is bad enough, But is there any other drawback of this approach?
How to prevent hard coding credentials into the source code?
Thanks
© Stack Overflow or respective owner