Reputation: 1823
I am working on this C# Windows Application (.Net 3.5, VS 2008) for which i have to create an exe file, No issues till now, The application consumes the betfair exchange API, which requires to "LOGIN" first thing to obtain a session token for any other service,
So my team-leader expects me to deploy the application in such a way that-
- The Application should ask the client for Username and Password at installation time
- If the user enters Username and Password, the application launches directly every time and uses the supplied username and password to log in to the web service automatically.
- If the user does not enters USER/Pass at installation time,then after installation the application must ask for username password each time it is launched.
So my main query is: How to get and store the username/password at installation time
i tried to write it in the app.config but it messes up with my web service settings somehow :/
Upvotes: 1
Views: 851
Reputation: 34248
Just a couple of things to note.
Firstly, app.config files are generally not considered secure media, so you shouldn't be storing username/passwords in them (especially if they aren't encrypted)
A common place for storing these details in windows applications is inside the registry (which can be permissioned to reduce security risks).
All passwords should be stored in an encrypted format. Unfortunately given that this needs to be used vs an external system this encryption will need to be reversible.
Upvotes: 1
Reputation: 72636
I think that you can do it with a slightly different approach :
/credentials
)You can save the credentials on the settings app.config file for the current user ...
Of course you will have to develop all the logic(form, ecc) linked to the /credentials
option .
Upvotes: 1