Tag Archives: C-Sharp

Building your own API and Securing it with oAuth 2.0 in ASP.NET WebAPI 2

Objectives:

  1. Make a true RESTful Web API (enable CRUD functions by HTTP POST, GET, PUT, and DELETE).
  2. Enable Cross-Origin Resource Sharing, i.e., CORS (the accessibility of the API by JavaScript can be controlled).
  3. Enable Secure Authorization for API calls (use the OAuth 2.0 authorization framework).
  4. Enable Transport Layer Security, i.e., SSL (reject every non-HTTPS request).

Continue reading

Getting started with Apache Thrift

[Prereq: Windows, Visual Studio, Eclipse]
[Project link: https://github.com/rfaisal/ThriftStarterCSharpServerJavaClient]

How it started:
Recently I have been introduced with a very cool technology called Apache Thrift. It is originally developed by Facebook and later open-sourced in Apache Software Foundation. It is one of the core building block of the Facebook technology. The technical paper introducing Thrift can be found here.

What is it:
In layman’s terms, Thrift allows an application written in one language (e.g., Java) to exchange data with an application written another language (e.g., C#). Probably the most popular technology in this area is SOAP. Although SOAP is more general, but Thrift has less overhead. In technical terms, Thrift is a Remote Procedure Call (RPC) framework that can be used to develop scalable cross-language services. Thrift is an interface definition language, i.e., you can only write interfaces or pure abstract classes by Thrift. The Thrift compiler can generate corresponding classes and interfaces for any particular language (e.g., C#) from the Thrift interface. The server (e.g., C#) should implement these interfaces and start a service, and the client (e.g., Java) can call the functions of these interfaces by communicating with the service.
Continue reading