Passive Federation Client

יום שני, יוני 3, 2013

As we all know it is simple to call a federated web site authenticated by AD FS 2.0 or any other identity provider using passive federation. The client is a browser that knows nothing about federation. All the browser knows is to send http requests and to submit html forms. It would be interesting to write a small library that will mimic the browser behavior and allow applications to call web sites using passive federation. such web sites can implement RESTful web services or any other http based API. Currently applications use ACTIVE federation which means they have...
no comments

My Talk in the SDP 2013

יום שני, מאי 6, 2013

Today I spoke about web identities and about Azure data sync. In the web identities talk I spoke about the identity concept and about the open ID, SAML and OAuth standards. In the Azure data sync talk I spoke about the value of sync, the Microsoft synchronization framework (MSF) and the Azure data sync service (which is based on MSF) Tomorrow I will speak about cryptography in .Net and explore different types of encryption algorithms and signing APIs. You can find the slide deck here: Web Idenytities ...
one comment

TPL Dataflow Resources

יום חמישי, דצמבר 8, 2011

"TPL Dataflow (TDF) is a new .NET library for building concurrent applications. It promotes actor/agent-oriented designs through primitives for in-process message passing, dataflow, and pipelining. TDF builds upon the APIs and scheduling infrastructure provided by the Task Parallel Library (TPL) in .NET 4, and integrates with the language support for asynchrony provided by C#, Visual Basic, and F#." If you are using the asynchronous queuing pattern within your process you want to look at this exiting framework. TPL Dataflow provides all the queuing and scheduling mechanism we had to implement manually for distributing workloads between tasks. It provides...
tags: ,
no comments

Asymmetric Encryption with RSACryptoServiceProvider

יום ראשון, ינואר 9, 2011

Traditional symmetric cryptography is all about hiding a secret using an algorithm and a key. The same key is used for encryption and decryption. Asymmetric encryption does much more. In Asymmetric encryption there are two key: one is kept secret (private) and the other is distributed (public). Both keys are mathematically the same – What makes the public key public is the fact that it was distributed. To perform a full cycle both keys are required (i.e. encryption with one key and decryption with the other). There are two possible scenarios: ...
one comment

How to write better code with Code contracts PEX and Moles

יום חמישי, אוגוסט 26, 2010

When I write code I always ask myself how can I make it better. One of the main steps I take to improve my code is write unit tests and use Asserts. All Code is based on assumptions. (i.e. a variable is not null etc). These assumptions must be validated before the code is executed. We all know that and I hope you all do that but still it happens my that code crushes because an assumption I forgot was not validated. I was looking for something to help be to improve my code and then I...
tags: , ,
no comments

Data Contract topology in WCF 4.0 – DataContractResolver

יום ראשון, אוקטובר 11, 2009

In WCF 3.x, type resolution was done using the “known types” mechanism. During deserialization, when the serializer encounters an instance that isn’t of the same type as the declared type, it inspects the list of declared “known types” to figure out what type to use. As the author of the service, you could annotate your types/methods with the or attributes to define the list of possible substitutions. (in code or config) Unfortunately, WCF 3.x doesn’t provide an easy way to override the type-mapping algorithm used by DataContractSerializer when performing this type of dynamic type...
tags: , ,
one comment

Spliting WCF config files

יום חמישי, מרץ 6, 2008

ConfigSource attribute on system.serviceModel section The configSource attribute was firstly introduced in .NET framework 2.0 to support external configuration files. This attribute can be added to any configuration section to specify a an external file for that section. Using an external configuration source can be useful in many scenarios. For instance, you could place a section into an external configSource if you need an easy method to swap settings for the section depending on the environment (development, test, or production), or  you need granular control over permissions. Unfortunately, the system.serviceModel section group does not support this attribute. If you try to add it, you will receive the following...
tags: ,
8 comments

Increase the numbers of threads in the Threat Pool

יום רביעי, מרץ 5, 2008

  If you have used the ThreadPool in .NET 1.x, you know that the threadpool defaults to ( 25 * number of processors ) threads per process.  It can be changed, but it is kinda complicated to track down how to change this.  Well, MS has made changing the threadpool to make this easily changeable.  Here is some example code:ThreadPool.GetMaxThreads(out iMaxThrds, out iThrdCompletionPT);  ThreadPool.SetMaxThreads(Environment.ProcessorCount * 50, iThrdCompletionPT); ThreadPool.GetMaxThreads(out iMaxThrds, out iThrdCompletionPT); For .Net 2.0 / 3.0  The first time that ThreadPool.GetMaxThreads is called, the value I recieved is 25, which is what I would expect from a system with 1 cpu. ...
tags:
one comment

Serializable Dictionary

יום שבת, פברואר 23, 2008

Serializable Dictionary I wanted to use a dictionary<T>  to create a MSMQ message but I found that a dictionary is not serializable. I spoke to a good friend “Adar Wesley” and he gave me the code of a Serializable Dictionary<T> he wrote. So here it is. Enjoy. Download: SerializableDictionary  
tags: , ,
2 comments