Skip to content

Instantly share code, notes, and snippets.

@jpda
Created January 12, 2015 21:52
Show Gist options
  • Save jpda/a532c993c75a2c97ef7e to your computer and use it in GitHub Desktop.
Save jpda/a532c993c75a2c97ef7e to your computer and use it in GitHub Desktop.
AuthorizationHeaderEndpointBehavior.cs
public class AuthorizationHeaderEndpointBehavior : IEndpointBehavior
{
public void ApplyClientBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.ClientRuntime clientRuntime)
{
clientRuntime.ClientMessageInspectors.Add(new AuthorizationHeaderMessageInspector(AzureAdToken.Get()));
}
public void AddBindingParameters(ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
{
}
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher)
{
}
public void Validate(ServiceEndpoint endpoint)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment