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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:48:59+00:00 2026-05-17T22:48:59+00:00

I have been creating a custom username/password validator for a WCF service and ran

  • 0

I have been creating a custom username/password validator for a WCF service and ran across the configuration item customUserNamePasswordValidatorType. I’ve been able to make my code work by following examples, but I just don’t understand what is going on. Unfortunately, the MSDN article doesn’t provide much detail.

This is the sample that Microsoft provides:

<serviceCredentials>
  <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Microsoft.ServiceModel.Samples.CalculatorService.CustomUserNameValidator, service" />
</serviceCredentials>

I’m trying to understand what the two parameters are to customUserNamePasswordValidatorType: “Microsoft.ServiceModel.Samples.CalculatorService.CustomUserNameValidator” and “service”.

Can someone please help me understand what these parameters mean?

Thanks!

  • 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-17T22:48:59+00:00Added an answer on May 17, 2026 at 10:48 pm

    This first parameter is the fully qualified name of the function the custom validation. The second parameter is the name of the assembly that function is contained in.

    Taken from a much better example of how to use custom validators (modified slightly to fit your example)

    namespace Microsoft.ServiceModel.Samples.CalculatorService
    {
        public class CustomUserNameValidator : UserNamePasswordValidator
        {
         // This method validates users. It allows in two users, 
         // test1 and test2 with passwords 1tset and 2tset respectively.
         // This code is for illustration purposes only and 
         // MUST NOT be used in a production environment because it 
         // is NOT secure.
         public override void Validate(string userName, string password)
         {
          if (null == userName || null == password)
          {
           throw new ArgumentNullException();
          }
    
          if (!(userName == "test1" && password == "1tset") && !(userName == "test2" && password == "2tset"))
          {
           throw new FaultException("Unknown Username or Incorrect Password");
           }
          }
         }
    }
    

    The above would be complied inside a assembly named service.

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

Sidebar

Related Questions

I have been in both situations: Creating too many custom Exceptions Using too many
I have been creating a website with Ruby on Rails, and will be hosting
I have been creating Unit tests like crazy and find that I'm often having
I have been tasked with creating a program that will generate an amortization schedule.
I have been tasked with creating a program what will create take files in
I have been tasked with creating a reusable process for our Finance Dept to
For my assignment I have been assigned the task of creating a DTD for
I have mastered creating custom data types and adding fields with CCK. Then I
Possible Duplicate: Creating a custom Document Library in SharePoint I have 2 users, Martin
I have a (custom) embedded jetty launcher which I had been using to develop/test

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.