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 8900571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:07:47+00:00 2026-06-15T01:07:47+00:00

I will appreciate if I can have a hello world example of how can

  • 0

I will appreciate if I can have a hello world example of how can I make a client have to supply a specific username and password in order to consume a wcf service. I am self hosting my service therefore it is not on IIS.

I have Server A and Client B. They are different computers on the same network.

I am using the default Service1 class that visual studio creates when creating a new WCF Class Library. So I create that service on Server A.

Then on Client B I add a service reference to that address which happens to be:
http://10.10.1.135:8732/Design_Time_Addresses/WcfServiceLibrary1/Service1/mex
(Client B is a console app)

In order to consume that service I have to do:

    static void Main(string[] args)
    {
        ServiceReference1.Service1Client svc = new ServiceReference1.Service1Client();

        svc.ClientCredentials.Windows.ClientCredential.UserName = "MyUserName";
        svc.ClientCredentials.Windows.ClientCredential.Password = "MyPassword";

        var a = svc.GetData(5); // consume the service            
    }

Note I had to use the username and password of the domain user. How can I do something similar using a custom password? I do not want to have to provide those cridentials and I also do not want to create new users on windows. It will be nice if I could validate against a database.

  • 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-06-15T01:07:48+00:00Added an answer on June 15, 2026 at 1:07 am

    Just Google it:

    http://codebetter.com/petervanooijen/2010/03/22/a-simple-wcf-service-with-username-password-authentication-the-things-they-don-t-tell-you/

    Simple ones:

    http://blogs.msdn.com/b/pedram/archive/2007/10/05/wcf-authentication-custom-username-and-password-validator.aspx

    http://www.codeproject.com/Articles/431358/Selfhosted-Secure-WCF-by-Id-password-custom-valida

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

Sidebar

Related Questions

I have these tables: USERS: user_ID username password email data_registered POSTS: post_ID user_ID post_title
In my current company, we have this decade old...let's call it a Hello World
Hello everyone I have a question that I will describe as good as I
Hello I have a website and want to make a gradient without an image.
Hello Those who have used WatiN likely also used DialogHandlers . Well can someone
Basic question.. had to ask. Any help will be appreciated. Q: Why can't I
Anyone that can help me out will be very much appreciated. I seem to
I will really appreciate help for this. My html v2 file with some temporary
Hello and thank you in advance. I have django installed on Bluehost. Everything seems
I have what I thought was a simple .NET Remoting Client/Server (Code Below)... When

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.