MutualCertificate with server x509 cert in the response

If you are getting error from the client saying something like this: Cannot find a token authenticator for the ‘System.IdentityModel.Tokens.X509SecurityToken’ token type. Tokens of that type cannot be accepted according to current security settings. and if you are happening to be using this security binding: SecurityBindingElement element = SecurityBindingElement.CreateMutualCertificateBindingElement(MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10); Then a very likely reason is that…

Custom Identity verifier

 Getting identity verifier error? Here is one way to work around it.  securityBindingElement.LocalClientSettings.IdentityVerifier = new CustomVerifier(); And Here is an example of how this custom verifier could be defined.       class CustomVerifier : IdentityVerifier        {            public CustomVerifier()                : base()            {            }             public override bool CheckAccess(EndpointIdentity identity, System.IdentityModel.Policy.AuthorizationContext authContext)            {                return true;            }             public override…

External tools in VS is your friend

Go to the Tools, click on External Tools … On the pop up dialogue, you can add some commands which are frequently used. For example, if you want to copy the current file. Instead of go open a new command window and navigate the right directory, you can add a command through Exteranl tool. Title: back it up Command:…

Open file the fastest way in VS: >of

Say i have a huge VS solution with quite a lot files which might exist under a lot of directories. and i want to open this one file. How do you usually do it? Go to File->Open->File the directory and click open; Or navigate to the right directory on the solution explorer, and double click on the file? What if you don’t remember which…


Best fonts for doing demo using VS

For presentation, start VS, go to Tools->Options, under Environment/Fonts and colors, choose Lucida Console, and font size 14. Choose Courier New, and font size 10 for writing code.  

How to distribute my public key portion of the cert to the Client in an "SSL" fashion

Distributing x.509 is always a painful thing, and using WCF, it no long is. In the WCF configuration, there is a knob in the configuration which helps the client to get the public key portion of the certificate in an “SSL” fashion.      <bindings>      <wsHttpBinding>        <!–         This configuration defines the security mode as Message…


What cert shall i use for WSE 3.0

If you are going to request one certificate from a cert authority, then you probably need to explicitly ask for the following key usages: Digital Signature, Key Encipherment and Data Encipherment. Use the mmc or WseCertificate3.exe tool to view the key usages from a certificate.

configuration entry intellisense

Wondering how do you ever get intellisense while writing configuration files using VS? Here is why? All the scchemas for VS are defined at {…}\VisualStudio\bin\i386\xml\schemas\dotNetConfig.xsd   If you have got some schemas definiations, just add it there. But please make sure you have a backup before you mess anything up.    

The .svc page only show the text value of the .svc file

Your IIS needs to link the .svc extension to the aspnet_isapi.dll. You can this by right click on your v-root from IIS manager. on the virtual directory tab, click on the Configuration button, and you will see the mappings tab, look for the entry with  .svc with excutable path map to aspnet_isapi.dll on your framework…

403.1 error while hosting WCF service using IIS

If you are getting 403.1 error while hosting WCF using IIS, then you might be using the wrong directory name. Let us say you want to host your service at http://localhost/A/service.svc  And the physical location of the service.svc file must be under the directory A.  {any local directory on your computer}/A/service.svc Hope this helps!