Recently Wade Wegner and his team, release the NuGet version of their Windows Azure Toolkit for Windows Phone with lots of improvements including one of the most important, modularization of all the things that the toolkit provides. In this post, I will focus on the new WindowsAzure.Storage.Proxy NuGet package, which provides the Windows Azure Proxies with Anonymous Authentication.
The Windows Azure Toolkit for Windows Phone provides a group of different tools to scale your device application in a really easy way. One of the most important tools that you can use is the Windows Azure proxies. This simple but powerful module provides a way to use a Storage Account from any kind of client without the need to share your private key and compromise your account. These proxies are used by the Android Toolkit and the iOS toolkit, and even you should use them from a Rich Desktop client, since itâ€™s not recommended to use your account settings in any kind of application that any kind of user can easily reflect.
The idea behind these proxies is really simple. All the traffic that passes thought them is redirect to the real Azure Storage adding the Authentication and the date headers needed to work with the service. In the case of Blob Storage instead of using this strategy, the proxies use the Shared Access Signature service to work directly with the real Storage.
Additionally, the proxies support adding authentication to the requests using ASP.Net Membership, Access Control Service, or even your own custom authentication in a really easy way. For example using Membership or ACS is as simple as install one more NuGet package and configure just one line in the “Activator” as itâ€™s shown in the NuGet package readme file.
If you prefer writing a custom authentication method, you can also modify the same line using your own implementation.
Using an authentication method is a must since if your proxy is anonymous; it can be used by anyone with no control by yourself, which can give you lots of headaches. Take into consideration for instance, that the blob storage is paid by usage.
The proxies also provide an extensible point to add Authorization to the request. With this feature you can have much more control for your proxies, your account and your application. To add some kind of authorization method go to the “activator” class and just set the AuthorizeTablesAccess, AuthorizeQueuesAccess or/and the AuthorizeBlobsAccess properties with your own authorization method.
List of available NuGet packages
Windows Azure Storage Client for Windows Phone:
Windows Azure Storage proxies:
Push Notification resources for Windows Phone:
Push Notification Registration Web Service:
The *.Membership and the *.AccessControl packages add Authentication using Membership or ACS respectively. Additionally, the *.Sample or the *.BasePage packages shows some examples of how to use the libraries.
Finally, you can find the source code of these NuGet packages at github.