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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:38:08+00:00 2026-05-26T05:38:08+00:00

I have developed REST WCF and set binding following way in web.config <bindings> <webHttpBinding>

  • 0

I have developed REST WCF and set binding following way in web.config

<bindings>
  <webHttpBinding>
    <binding name="secureBasic">
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="None" />
      </security>
    </binding>
  </webHttpBinding>
</bindings>

<serviceBehaviors>
    <behavior name="ServiceBehaviour" >
      <serviceCredentials>
        <userNameAuthentication customUserNamePasswordValidatorType="RestService.CustomUsernamePasswordValidator, RestService"
                            userNamePasswordValidationMode="Custom" />
      </serviceCredentials>
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>

  </serviceBehaviors>

And in CustomUsernamePasswordValidator.cs file i have authenticate user by following way

namespace RestService
{
public class CustomUsernamePasswordValidator : UserNamePasswordValidator
{
    public override void Validate(string userName, string password)
    {
        if (!AuthenticateUser(userName, password))
            throw new SecurityTokenValidationException("Invalid Username or Password");
    }

    private bool AuthenticateUser(string userName, string password)
    {
        if (userName == "myaddon" && password == "mypassword")
        {
            return true;
        }
        else
            return false;
    }
}
}

Now problem is that it is running nice when i will use this service from same project but confused that why this call would not occurred for validation?

Also when i test my heroku manifest addon file from ruby commnad propmpt it give me error of
Failed Authentication !! I think this is issue of my REST WCF Application.

Please anyone can help me to solve this issue if anyone know very well about WCF and authentication.

Thanks
Arun.

  • 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-26T05:38:09+00:00Added an answer on May 26, 2026 at 5:38 am

    Finally i have handle custom authentication using WebOperationContext directly and skip the Web.Config settings.

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

Sidebar

Related Questions

I have developed an rest enable wcf service by using the following link http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx
I have developed a rest web service by using the following link http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx Now,
I have developed a sample WCF REST service that accepts that creates an Order
I have developed one REST WCF and would like to client will use it
I have developed REST web service which is able to accept some data, load
I have developed a VB.NET WCF service that recives and sends back data. When
I've built a REST API with the WCF Web API Preview and I wanna
I have developed one WCF application, and it is working as a middle layer
I have a C# WCF REST Service which allows the addition of a bookmark,
I have developed a REST service with Apache Jersey, running on Tomcat. It works

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.