Creating Private Windows Phone 7 Applications That Use Service Based Security

Version: 1.0.0

Description

In this lab you will learn how to create a Windows Phone 7 application that uses a Windows Azure WCF Service to unlock the application. You will also learn how to provide users the functionality they need to call the Windows Azure WCF Service and conditionally unlock the application based on the results returned from the service.

Overview

The Windows Phone 7 marketplace does not have a concept of a private marketplace. Applications published to the marketplace are visible to everyone. When deploying an application for all the users in a large organization, using the marketplace is the most efficient way to go about it. Developers must take steps to ensure applications deployed to the public marketplace are only used by authorized employees and not the public. In this scenario, to ensure maximum security no usernames, passwords, or salts are stored on the Windows Phone device. These values must be entered each time the application is restarted.

Objectives

In this hands-on lab, you will learn how to create a Windows Phone 7 application that uses a Windows Azure WCF Service to unlock the application. You will also learn how to provide users the functionality they need to call the Windows Azure WCF Service and conditionally unlock the application based on the results returned from the service.

  • Learn how to create a Windows Azure WCF Service that validates the information necessary to unlock an application.
  • Learn how to provide users the functionality they need to call the Windows Azure WCF Service and conditionally unlock the application.

Prerequisites

The following is required to complete this hands-on lab:

Note:
See Setting Up A SharePoint and Windows Phone 7 Development Environment Module for instructions that describe how to set up the SharePoint and Windows Phone 7 developer machine.

Note:
The following prerequisites are not included in the Setting Up A SharePoint and Windows Phone 7 Development Environment Module installation instructions. If you are using a development machine built according to the Setting Up A SharePoint and Windows Phone 7 Development Environment Module instructions you must install these components.

First-Time Configuration of the Windows Azure Simulation Environment

Note:
The Windows Azure SDK (included in Windows Azure Tools for Visual Studio) installs a simulation environment on your development machine for testing Azure applications locally before deploying them to the cloud. The simulation environment consists of the development fabric to host web and worker roles, and the development storage which simulates cloud blob, table and queue storage locally.

Development storage uses SQL Server as its underlying storage mechanism, and by default the SDK will attempt to configure it to use SQL Server Express. If you do not have SQL Server Express installed before installing the SDK, or you wish to simply use an existing SQL Server instance to host the development storage database, you must run the dsinit command to select the SQL Server instance where the database will be created.

Please see instructions below for how to run dsinit.

Using dsinit to Configure Development Storage

  1. Open a command prompt.
  2. Edit the following command line as appropriate for your environment, where [AzureSDKInstallDrive] is the drive where you installed the Azure SDK (or Windows Azure Tools for Visual Studio), and [YourSqlInstance] is the SqlServer where you want to create the development storage database.

    [AzureSDKInstallDrive]\ Program Files\Windows Azure SDK\v1.4\bin\devstore\dsinit.exe /sqlinstance:[YourSqlInstance]

    Example Command Line:“C:\Program Files\Windows Azure SDK\v1.4\bin\devstore\dsinit.exe” /sqlinstance:.

  3. Note that the sample command line above uses the value “.” for the sqlinstance argument, which specifies that the local default SQL instance will be used for development storage.