Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting windows username inside app. 1

Status
Not open for further replies.

NuWood

Programmer
Mar 14, 2002
44
GB
Hi

I need to be able to set a username/password within the application I have developed so that the application can access network resources (folders) but the user of the app cannot. This is to protect the content of the folders as the app needs read, write and delete access but the user does not need any access at all except via the application.

Is there a windows call I can use? Has anyone got any examples of it's use?

regards
Andrew
 
I'm fairly sure it's possible to do this via requesting security tokens (have a look at thread102-1302880) to get yourself started.

But - my thoughts are that this is the wrong approach. Storing usernames and passwords on remote machines can get you into trouble, say, if the username and password were discovered by someone. Changing them for every machine may not be fun.

You may want to consider getting data via a TCP stream. Rather than use the windows networking to send/receive files, I use Indy's TIdTCPClient and TIdTCPServer to communicate between two apps that can send and receive any data they like. You would set up the TIdTCPServer in a service application, which is installed on the same machine that contains the data you need to share.

It may sound as if you're just obfuscating things with this approach, but it allows you to do all sorts of things such as logging, streamed updates and access via internet or WAN.

Hope that's helpful.
 
Thanks for the info.

The application is a 3 tier product and I have considered placing the file access into a 'server' app and streaming it but I need a quick solution for now. As for the username and password it would be stored on the database to which the clients have no access except via the app server so I am covered on the security and update fronts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top