Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 506487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:42:23+00:00 2026-05-13T06:42:23+00:00

Lately I’ve been working in an office with a wireless network which uses an

  • 0

Lately I’ve been working in an office with a wireless network which uses an annoying authentication scheme: every few hours, you need to open up a browser and type a username/password into an authentication web page, or you lose network access. (When the time expires, your next browser request will redirect to the auth page, and if your creds pass muster, then you’ll be redirected back to the page you were trying to get to originally).

This kind of annoyance may be OK for an airport or coffee shop wireless, but in an office it’s infuriating– especially if you’re working with network services (e.g. SVN, email) which suddenly stop working every few hours unless you bring up a browser.

So I have written a tiny C# console app which will log in for me by sending an HTTP request to the login form with my credentials.

This is obviously insecure– my password is sitting inside my source code for all to see. I’d prefer to be able to save my credentials using the same mechanism that IE, for example, uses to save and re-fill passwords in web forms.

Ideally, I’d like a re-usable component for entering, saving, and retrieving credentials(including the UI with an optional “save creds” checkbox) so that my app can simply do something like this (in pseudocode):

// retrieve any saved credentials from some secure place
Credentials creds = GetCreds(some parameters go here);

// if none stored, then show the user an "enter and optionally save credentials" dialog
if (creds == null)
    creds = GetCredsDialog(some parameters go here);

// POST to the authentication page
if (creds != null)
{
    string authUrl = "https://somehost/login/";
    string postDataPattern = "post data pattern here";

    // use SecureString here instead?
    string postData = string.Format (postDataPattern, HttpUtility.HtmlEncode(creds.Username), HttpUtility.HtmlEncode(creds.Password));
    WebClient wc = new WebClient();
    string html = wc.UploadString (authUrl, "POST", postData);

    // TODO: if html indicates login failure, clear stored credentials 
    // and ask for new creds. then retry.
}

Essentially I want to shift the burden of securely storing creds from my app to Windows, under the assumption that the Windows guys will be better at this than I will be. 🙂

I’m not looking for iron-clad security here, just something comparable to what IE is using to secure my other stored passwords for other websites. I just don’t want to keep plain text passwords in my code!

Of course, the right solution here is to work with the IT department to get them to get a real authentication scheme for Wireless, but in the meantime I’m on my own.

A .NET solution would be preferable, but a Win32 solution would be OK too– I could simply port the app to C++ without much trouble.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:42:23+00:00Added an answer on May 13, 2026 at 6:42 am

    To store the credentials, use the ProtectedData class in System.Security.dll.
    By passing DataProtectionScope.CurrentUser, no other user will be able to decrypt the data.

    EDIT: For the dialog, you can use the CredUIPromptForCredentials API function

    See here for a .Net wrapper.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lately, I'v been struggling with an annoying situation on ASP.NET MVC. Here's the story
Lately I've been working on stored procedure and encountered 1 strange problem. First, I
Lately I've been working on implementing security for my web application, running on a
Lately I have been working on OS X. Things were going pretty peachy for
Lately I have been working with predictive analytics and in many cases my PC
Lately I have been trying my hands on Eclipse IDE for java development. I
Lately I've been favoring using named pipes (option --enable-named-pipes) in MySQL running on windows,
Lately I've been thinking a lot about building a website/blog/community oriented site. However I
Lately I've been job hunting, and for the most part, they would ask me
Lately I have been experiencing Eclipse Galileo (3.5) slowing down under Java 1.5b12 OR

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.