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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:09:13+00:00 2026-06-04T17:09:13+00:00

After solving my previous problem, I wanted to convert the netTcpBinding to a customBinding,

  • 0

After solving my previous problem, I wanted to convert the netTcpBinding to a customBinding, which I managed succesfully. However, WcfTestClient (and normal client) give an error while trying to extract metadata when I put a custom authorization policy in place (it works fine without!).

My config:

<serviceAuthorization principalPermissionMode="Custom">
        <authorizationPolicies>
          <add policyType="Sample.Tools.CustomAuthorizationPolicy, Sample" />
        </authorizationPolicies>

I’ve read on MSDN (here: http://social.msdn.microsoft.com/Forums/en-IE/wcf/thread/80a33bc6-0765-45f6-8af5-0a414a5cc40d) that this may be caused because a custom authorization manager is also required. I tried this and added the CustomAuthorizationManager as well (with CheckAccessCore always returning true), but it didn’t work.

This is added in the config as:

    <serviceAuthorization principalPermissionMode="Custom" serviceAuthorizationManagerType="Sample.Tools.CustomAuthorizationManager, Sample">
        <authorizationPolicies>
          <add policyType="Sample.Tools.CustomAuthorizationPolicy, Sample" />
        </authorizationPolicies>

The rest of the config:

Binding:

<customBinding>
      <binding name="SampleBinding" receiveTimeout="00:05:00">
        <transactionFlow/>
        <security authenticationMode="SecureConversation" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
            <secureConversationBootstrap authenticationMode="UserNameForSslNegotiated" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
                <localClientSettings maxClockSkew="23:59:59" />
                <localServiceSettings maxClockSkew="23:59:59" />
           </secureConversationBootstrap>                   
            <localClientSettings maxClockSkew="23:59:59" />
            <localServiceSettings maxClockSkew="23:59:59" />
        </security>
        <binaryMessageEncoding/>
        <tcpTransport transferMode="Buffered" portSharingEnabled="true" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard"/>
      </binding>
    </customBinding>

Behavior:

<behavior name="SampleBehavior">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="true" httpHelpPageEnabled="true" httpsHelpPageEnabled="true" />
        <serviceAuthorization principalPermissionMode="Custom" serviceAuthorizationManagerType="Sample.Tools.CustomAuthorizationManager, Sample">
        <authorizationPolicies>
          <add policyType="Sample.Tools.CustomAuthorizationPolicy, Sample" />
        </authorizationPolicies>
      </serviceAuthorization>
      <serviceCredentials>
        <serviceCertificate findValue="MySample" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
        <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Sample.Tools.CustomUserNameValidator, Sample" />
      </serviceCredentials>
      <serviceThrottling maxConcurrentCalls="2147483647" maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647" />
    </behavior>

Services:

<services>
    <service behaviorConfiguration="SampleBehavior"
    name="Sample.SampleService">
    <endpoint address="" 
              binding="customBinding" 
              bindingConfiguration="SampleBinding"
              name="MyServiceEndpoint" 
              contract="Sample.ISampleService">
        <identity>
            <dns value="localhost" />
        </identity>
    </endpoint>

    <endpoint address="mex" 
              binding="mexTcpBinding" 
              bindingConfiguration=""
              name="MyServiceMexTcpBidingEndpoint" 
              contract="IMetadataExchange" />
        <host>
            <baseAddresses>
                <add baseAddress="net.tcp://localhost:809/SampleService.svc" />
            </baseAddresses>
        </host>
    </service>
</services>    

I’m pretty much stuck here and there is very little to find regarding this issue.

  • 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-04T17:09:14+00:00Added an answer on June 4, 2026 at 5:09 pm

    I came across this nice post here: http://social.msdn.microsoft.com/forums/en-US/wcf/thread/86ed7974-97d4-4cc8-a965-542a3063aced

    This fixed my issue, now I need to look into implementing a proper ServiceAuthorizationManager 🙂

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

Sidebar

Related Questions

After solving my last problem with CSS position a new one came up. Live
I'm playing with Haskell and Project Euler's 23rd problem. After solving it with lists
After solving the other problem with routes , now I have another one. I
Edit: Below is my original question. After solving my problem, I thought I'd re-edit
Well, after solving this problem by naive STL set,I was reading the forum entries,there
After finally solving the jar signing problem (thank you everyone for your help!), a
I am solving a quantum-mech problem which requires me to find some eigenvalues by
This question comes after solving the problem I got in this question . I
After solving part of my problem over here , I realized that I could
After solving countless problems with the hg-fast-export tool on Windows (from finicky python version

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.