Tag Archives: windows

Override the Default Login to provide Customized Identities in Windows Azure Mobile Services

It is very easy to override the default login feature (accessible by /login/[provider] endpoints) of the Windows Azure Mobile Services and customize it according to the need of your app. In this blog post, I am going to discuss how to do that, in particular, we want to be able to do the following:

  1. Add custom claims to the identity (the ability to provide authorization after authentication). In this example, we will add custom claims to the facebook identity.
  2. Add a new oAuth identity provider (in addition to the ones supported by the Windows Azure Mobile Services). In this example, we will add Foursquare as the new identity provider.
  3. Add a simple classical identity provider (login by username and password).
  4. Add support for multiple apps using the same backend. It is necessary, if you have a public API exposed and other people are making apps using your backend.

In this post, I am going to use the oAuth flow described in my previous blog post, which is:

  1. the app verifies the identity of the user elsewhere, i.e., native facebook app, and acquire an access_token,
  2. this access_token is used to login to Windows Azure Mobile Services.

But, the examples are easily extendable to any standard oAuth flow.

Continue reading

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

Follow

Get every new post delivered to your Inbox.