Skip to content

Tag: WebAPI

C#/.NET 4

Manual JWT Validation against Azure Active Directory

For our current WebApi project we decided to implement OAuth2 authentication with Azure Active Directory. As our API needs to support other authentication mechanisms like Basic and Negotiate beside OAuth2 we implemented multiple authentication filters that, where each filter is responsible for a specific authentication mechanism. One of these authentication filters, the BearerAuthenticationFilter, is responsible to handle requests that contain […]

C#/.NET 0

Using CodeContracts with OData Controllers and Web.Api Exception Filters

When writing ODATA controllers for our projects we spend quite some time on writing boilerplate code and input parameter validation. In addition, for our error handling we would like detailed information for internal troubleshooting but not so detailed information sent back to the client (i.e. no stack traces). In order to achieve this without extra work we started looking at […]

LightSwitch 0

Using LightSwitch with EntityFramework 6 and CodeFirst based ODATA Controllers

Enhancing LightSwitch applications with additional ODATA or WebAPI controllers is a pretty common task. However when you try to build a CodeFirst based controller in combination with EntityFramework 6, you will run into a lot of errors by default. Here are the steps to get this cleared and running: 1. Create a Visual Studio LightSwitch HTML project In this example […]

LightSwitch 2

WebAPI and “The response to this POST request did not contain a ‘location’ header. That is not supported by this client.”

I just came across another nuisance in .NET WebAPI that I want to share with you quickly. In one of our LightSwitch projects we use WebAPI ODATA controller to help out when LightSwitch internal capabilities come to their end. As we are using a PowerShell once in a while as you might already have guessed from our web site we […]

LightSwitch 0

Microsoft.AspNet.WebApi.Client 5.2.0 not compatible with LightSwitch Silverlight Client

When trying to add the current “Microsoft.AspNet.WebApi.OData” to a LightSwitch project I got the following error message: We are not using Silverlight in our application, only the HTML client – except when doing user and role administration … As a matter of fact we only need the package on the server layer anyway. So the solution to this is to […]