How does “Exports” work in Node JS

1 בינואר 2014

If you wandered how does exports works under the covers here in the answer. The trick is simple: wrap your function (object definition) with a wrapper function that accepts the exports object from the global scope. This makes exports global, allows you to attach your code to it and prevents your code from reaching the global scope. 1: //wrapper function 2: (function (exports, require, module, __filename, __dirname) { 3: //your code 4: var calculator = function() { 5: ...
no comments

Facebook Presto Vs Cloudera Impala

25 בדצמבר 2013

If you want to know what is the difference between these two MPP databases I recommend reading the following post. currently both are using Hive query language HQL and use its metadata store. They have great performance yet they do not support user defined functions. In the near future all the current limitations will disappear (more serializations will be supported as well as UDFs) and there will be no REAL use case for using Hive. I know that there is working going on to improve Hive’s performance (X100) but we have to wait and see. Enjoy Manu
no comments

How to Authenticate Web API using OAuth 2.0

15 באוקטובר 2013

My friend Bnaya Eshet asked me about web api authentication so I decided to write a post about it… To authenticate a simple http request in a Web API service you have to send a token in the http authorization header. Theoretically you can send any type of token as long as the application can validate it and make sense out if it but practically you will send a JWT token. JWT (JSON Web Token) is a simple token format that becomes the leading token format for OAuth 2.0 providers. JWT token represent a set of claims...
one comment

Auth0 – An Exciting SSO Infrastructure

30 בספטמבר 2013

When we think about SSO we have to think about simplicity, multi-platform integration, deployment scenarios (cloud / on-premises) and standard compliance. Unfortunately Microsoft solutions (ADFS, WAAD, ACS) are focused on SAML 1.1 and assume that applications has the ability to parse and validate such tokens. (WAAD and ADFS has OAuth previews which are currently not stable, ACS can use WRAP OAuth which not relevant) This assumption is problematic in the mobile era. Web Platforms today do not include strong XML stacks that are required to handle SAML tokens and so applications and especially mobile applications cannot handle...
no comments

NServiceBus PubSub Is Static and Does Not Support Publisher Side Filtering

12 בספטמבר 2013

NServiceBus has a simple Pub\Sub infrustructure. I use the word simple because it is simple to use. In NServiceBus subscriptions are defined statically. The NserviceBus scans your code and decides that A has to subscribe to B for messages of type M. If a A (Billing) has a class that handles message of type M (OrderAcccepted) and those messages are configured to be under the responsibility B (OrderProcessing), NServiceBus will initiate a subscribe request from A to B for messages M. (see the following example) public partial class...
no comments

Pub Sub Across Servers Using Redis

11 בספטמבר 2013

Redis is famous key value store that uses memory as its primary storage. This is why it is known for its speed and is often being used as a distributed cache in distributed systems. One important feature of Redis is its pub/sub system. With Redis Pub/Sub, processes can communicate and implement the publish subscribe pattern (one process publishes a message and many other can listen). More on Redis pub/sub can be found here. The question I’d like to discuss is how to do this across servers. When all participants are connected to the same...
no comments

Bug in ADFS. OAuth access token can be requested in UTC time zone only

9 בספטמבר 2013

My friend Assaf Israel showed me a bug in the new ADFS version in Windows Server 2012 Preview. When calling ADFS endpoint /oauth/authorize to get an authorization token the server will call the method BeginAdd in the class Microsoft.IdentityServer.Server.ArtifactResolutionService.ArtifactService to creates an artifact with an authorization token and store it in the database. The server will set the expiration date to be UTC time + 5 min. if (DateTime.Compare(artifact.Expire,DateTime.MinValue) == 0) artifact.Expire = DateTime.UtcNow.AddSeconds((double).artifactService.LifetimeInSeconds); When calling /oauth/authorize to get an...
3 comments

Active Federation with ADFS 2.0 in C#

27 באוגוסט 2013

A customer asked me how to establish active federation in C# with two ADFS servers. The scenario is simple: - One ADFS acts as an STS (it authenticate the client) - The  Second ADFS acts as an R-STS and provides a token to the RP (application) using the token created   by the first STS. The code is simple and is based on .Net 4.5 WIF System.IdentityModel In the first step the client authenticate to the STS and get a SAML token:...
tags: , ,
no comments

How to choose a No SQL Database

10 ביולי 2013

A customer asked me the other day how to choose the right No SQL Database? Unfortunately this is not an easy task. There are over 150 different offerings and there are significant differences between them. The best advice I can give is “Choose the database that matches best your problem”. No SQL Databases can be categorized into four major groups.  ...
6 comments