News

Azure Mobile Services .NET Adds CORS Support, Better Authentication

Support for cross-origin resource sharing now built in via the ASP.NET Web API.

Microsoft's Azure Mobile Team has an update to its Azure Mobile Services .NET that adds has built-in support for the cross-origin resource sharing specification, as well as improved authentication.

Azure Mobile Services is aimed at mobile developers who want to plug in a cloud-hosted backend to their mobile apps. It uses the ASP.NET Web API and is fully supported in the Visual Studio IDE.

Cross-origin resource sharing is a specification for standardizing cross-domain requests that bypasses JavaScript's same-origin policy. The CORS support in Azure Mobile Services .NET comes by way of support now embedded in the ASP.NET Web API 2.2 Cross-Origin Support 5.2.0 package, which can be downloaded via this Nuget package.

CORS is not enabled by default in Azure Mobile Services .NET, and must be turned on through the Azure management portal or set through the MS_CrossDomainOrigins app setting. Once done, CORS policy can be set at "a per-service, per-controller, or per-action level," blogs Henrik Frystyk Nielsen, principal architect for Microsoft Azure Mobile Services.

Authentication methods have also been improved. Besides authentication via Azure Active Directory, Twitter, Facebook, Google, and Microsoft Account, other authentication methods can be customized. Nielsen writes of an example using LinkedIn authentication that uses an OWIN middleware and registration of that package through the LoginProvider.

Azure Active Directory Authentication has been built in from the beginning, but Nielsen writes that it has been improved "using a server-side flow simplifying client authentication significantly."

Details and download instructions are here.

About the Author

You Tell 'Em, Readers: If you've read this far, know that Michael Domingo, Visual Studio Magazine Editor in Chief, is here to serve you, dear readers, and wants to get you the information you so richly deserve. What news, content, topics, issues do you want to see covered in Visual Studio Magazine? He's listening at [email protected].

comments powered by Disqus

Featured

  • Full Stack Hands-On Development with .NET

    In the fast-paced realm of modern software development, proficiency across a full stack of technologies is not just beneficial, it's essential. Microsoft has an entire stack of open source development components in its .NET platform (formerly known as .NET Core) that can be used to build an end-to-end set of applications.

  • .NET-Centric Uno Platform Debuts 'Single Project' for 9 Targets

    "We've reduced the complexity of project files and eliminated the need for explicit NuGet package references, separate project libraries, or 'shared' projects."

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

Subscribe on YouTube