Building OAuth channel for WCF RESTful services

 

What is OAuth?

While OpenID and WS-Federation focus on delegating user identity (or a collection of identity claims), OAuth was designed to address a different and complementary scenario, the delegation of user authorization. In few words, OAuth allows a client application to obtain user consent (i.e. Authorization for consuming a private resource as access tokens) for executing operations over private resources on his behalf.

If you want to know more about how OAuth works, you should read the following posts

OAuth .NET Library

Alex Henderson (Aka Bittercoder) has written a pretty good OAuth library in .NET for implementing an OAuth consumer and service provider. The library is available here under a MIT license (do wherever you want with it), and it is very easy to use. Alex has definitively made a very good work.

OAuth WCF Channel using REST Starter Kit’s RequestInterceptor

WCF channel implementation for OAuth mounts on top of his library and it basically transforms a OAuth token into a .NET security principal that can be used later within the service implementation. The channel is implemented as a RequestInterceptor, one of new features introduced in the REST WCF Starter Kit. This interceptor basically captures the request at channel level and performs all the validations required by OAuth. The following sample illustrates how the interceptors can be plugged into an existing service host (service.svc),

Samples here: OAuth channel for WCF RESTful services – Pablo M. Cibraro (aka Cibrax)

Wix# (WixSharp) – managed interface for WiX

 

Wix# (WixSharp) – managed interface for WiX

By Oleg Shilo

This article describes Wix# (WixSharp), a managed interface to WiX (Windows Installer XML toolset for building Windows installation packages from the XML source code). Wix# allows building a complete MSI or WiX source code by using script files written with the C# syntax. It uses a C# class structure to mimic WiX entities and their relationships in order to produce a valid deployment model.

Diagrams showing MSI Deployment with Visual Studio and directly with WiX

image

image

 

Wix# Overview

The Wix# concept is quite simple. The Wix# source file is an ordinary C# file containing code defining relationships between instances of Wix# classes. Wix# classes represent deployment entities: files, shortcuts, registry values etc. The Wix# source file can be translated by the Wix# engine into the WiX source file, which then (optionally) can be automatically compiled into MSI. 

Sample:

Script for installing MyApp.exe into <ProgramFiles>\My Company\My Product directory; showing a custom license file; creating shortcuts to Install/Uninstall the product and to launch MyApp.exe from <Desktop> and <ProgramMenu>:

using System;

class Script
{
    static public void Main(string[] args)
    {
        var project = new WProject(“MyProduct”,
                          new WDir(@”%ProgramFiles%\My Company\My Product”,
                              new WFile(@”Files\Bin\MyApp.exe”,
                                  new WShortcut(@”%ProgramMenu%\My Company\My Product”),
                                  new WShortcut(@”%Desktop%”)),
                              new WShortcut(“Uninstall MyApp”, “[System64Folder]msiexec.exe”, “/x [ProductCode]“)),
                          new WDir(@”%ProgramMenu%\My Company\My Product”,
                              new WShortcut(“Uninstall MyApp”, “[System64Folder]msiexec.exe”, “/x [ProductCode]“))));
       project.Id = new Guid(“6f330b47-2577-43ad-9095-1861ba25889b”);
       project.LicenceFile = @”AppFiles\License.rtf”;
       WCompiler.BuildMsi(project); }
}

Via CodeProject: Wix# (WixSharp) – managed interface for WiX. Free source code and programming help

Small Basic

 

SmallBasic

Small Basic is a project that’s aimed at bringing “fun” back to programming. By providing a small and easy to learn programming language in a friendly and inviting development environment, Small Basic makes programming a breeze. Ideal for kids and adults alike, Small Basic helps beginners take the first step into the wonderful world of programming.

  • Small Basic derives its inspiration from the original BASIC programming language, and is based on the Microsoft .Net platform. It is really small with just 15 keywords and uses minimal concepts to keep the barrier to entry as low as possible.
  • The Small Basic development environment is simple, yet provides powerful modern environment features like Intellisense™ and instant context sensitive help.
  • Small Basic allows third-party libraries to be plugged in with ease, making it possible for the community to extend the experience in fun and interesting ways.

Getting Started Guide

Forums

FAQ

Small Basic Blog

Samples

Microsoft Small Basic aims to make computer programming accessible to beginners.

Download

Getting Started

  1. Download and install Small Basic
  2. Follow the Getting Started guide (docx or pdf) to build your first application

Windows Azure: FAQs and resources

 

Resources:

Windows Azure Tech Page : http://msdn.microsoft.com/en-us/azure/cc994380.aspx
Windows Azure SDK documentation : http://msdn.microsoft.com/en-us/library/dd179367.aspx
Cloud Computing Tools team Technology page: http://msdn.microsoft.com/en-us/vstudio/cc972640.aspx

Walkthroughs:

Introduction
Quick Lap around the Windows Azure Tools for Microsoft Visual Studio

Using the Cloud Service Project Roles Node

Windows Azure Tools Development Fabric and Storage Integration

Deploying a Service (Interesting for folks who don’t have a token yet but want to see the experience)
Deploying a Service on Windows Azure

 

Channel 9 Videos :

A Lap around Windows Azure – Manuvir Das (PDC)
Essential Cloud Storage Services – Brad Calder (PDC)
Introducing Windows Azure – Channel 9 Interview with Manuvir Das
Windows Azure for Developers – Channel 9 Interview with Steve Marx

eBooks & White Paper:

e-books and white papers on Microsoft.com regarding these new technologies.

1. Introducing the Azure™ Services Platform

Using computers in the cloud can make lots of sense. Rather than buying and maintaining your own machines, why not exploit the acres of Internet-accessible servers on offer today? Get an early look into the Azure Services Platform in this White Paper by David Chappell.

http://download.microsoft.com/download/e/4/3/e43bb484-3b52-4fa8-a9f9-ec60a32954bc/Azure_Services_Platform.docx

2. Getting Started with Microsoft SQL Data Services – A Developer’s Focus

Microsoft® SQL Data Services (SDS) offers highly scalable, Internet-facing, enterprise-class database and advanced query processing for customers who want to build new applications or extend existing investments into the cloud. This paper explains the key features and architecture of SDS, and describes how you can start programming with SDS in your own applications.

http://download.microsoft.com/download/8/b/4/8b4aa374-cbee-4e6b-9f01-c9177204b6e1/Microsoft%20SQL%20Data%20Services%20-%20Developer%20Focus.pdf

3. Microsoft SQL Data Services – Under the Hood

Microsoft SQL Data Services (SDS) is a cloud-deployed database service from Microsoft. SDS provides a web-facing database, retrieval, and manipulation features in a hosted, Web-facing solution. Cloud-deployed database solutions such as SDS can provide many benefits to the enterprise, including rapid provisioning, cost-effective scalability, high availability, and reduced management overhead. This paper provides an architectural overview of SDS, and describes how you can use SDS to augment your existing on-premises data infrastructure.

http://download.microsoft.com/download/8/b/4/8b4aa374-cbee-4e6b-9f01-c9177204b6e1/Microsoft%20SQL%20Data%20Services%20-%20Under%20the%20Hood.pdf

 

Via Welcome To Windows Azure Forum : FAQs and resources : Windows Azure : Azure : MSDN Forums

Live Framework: FAQs and Resources

 

Resources:

1. Documentation: http://msdn.microsoft.com/en-us/library/dd156996.aspx

2. Walkthroughs:

a. Developing applications using Live Framework (different scenarios in Microsoft Word Format)

b. Getting started with Live Framework Tools for Microsoft Visual Studio

3. PDC 2008 Sessions and Videos related to Live Services/Live Framework

a. [PDC 2008 Session] What I Learnt Building My First Mesh Application

b. [PDC 2008 Session] Programming Live Services Using Non-Microsoft Technologies

c. [PDC 2008 Session] Live Framework: Architecture and Insights

d. [PDC 2008 Session] Building Mesh-enabled Web Applications using Live Framework

e. [PDC 2008 Session] Building Applications with the Live Framework

f. [PDC 2008 Session] A Lap around Live Framework and Mesh Services

g. [Channel9 Video] Inside Live Framework

h. [Channel9 Video] Inside Live Services

Via Live Framework: FAQs and Resources : Live Framework : Azure : MSDN Forums

Using the Microsoft URL Rewrite Module for IIS 7.0

 

An Introduction to URL Rewriting

One of the greatest things about dynamic Web sites is the fact that you can build one page and based on the parameters that are passed to that page it can display any number of different results. For example, let’s say that you’re building a Web-based grocery store. Instead of creating a separate static HTML page for each category of product you carry, you can simply create a single Category.aspx file and pass it a parameter indicating what category of products you want to display:

http://www.MyVirtualGroceryStore.com/Products/Category.aspx?Category=Fruit
http://www.MyVirtualGroceryStore.com/Products/Category.aspx?Category=Meat
http://www.MyVirtualGroceryStore.com/Products/Category.aspx?Category=Vegetables

While the resulting Web pages are all generated by the single script, they’ll each display a very different lists of items. This type of power is great for us as developers, but it’s not so good for users and even worse if you’re trying to get the pages indexed by search engines. While I created the examples above to be as user-friendly as possible, they’re still not all that simple to the average user. These are simpler and much more intuitive:

http://www.MyVirtualGroceryStore.com/Products/Fruit
http://www.MyVirtualGroceryStore.com/Products/Meat
http://www.MyVirtualGroceryStore.com/Products/Vegetables

So, ever since developers started building dynamic pages and confusing users and search engines, people have been trying to find a way to get the best of both worlds. One of the most common solutions is URL rewriting. URL rewriting is where a user can request a page via the user-friendly URL:

http://www.MyVirtualGroceryStore.com/Products/Fruit

and the Web server figures out to actually use the the script located at:

http://www.MyVirtualGroceryStore.com/Products/Category.aspx?Category=Fruit

to build and return the resulting Web page.

Introducing Microsoft URL Rewrite Module for IIS 7.0:

The first step is to make sure you can use the module. You’ll need to make sure you’re running IIS 7.0 or later (which means Windows Server 2008 or Vista). You’ll also need interactive access to the server to run the install routine. If you meet the above requirements, you can download the version of the module that matches your server’s platform from the IIS 7.0 Web site:

image  image image

Via 15 Seconds : Using the Microsoft URL Rewrite Module for IIS 7.0

Using jQuery with ASP.NET – Rick Strahl

 

1. An Introduction to jQuery – The Client Side

What’s covered

2. Making Ajax Callbkacs to the Server

What’s covered