Skip to content

Instantly share code, notes, and snippets.

@dcomartin
Last active February 7, 2019 01:03
Show Gist options
  • Save dcomartin/ee0bbaedfb60f024a45d5da27ca8383a to your computer and use it in GitHub Desktop.
Save dcomartin/ee0bbaedfb60f024a45d5da27ca8383a to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication()
.AddJwtBearer(options => {
options.Events = new JwtBearerEvents
{
OnMessageReceived = context =>
{
var accessToken = context.Request.Query["access_token"];
if (string.IsNullOrEmpty(accessToken) == false) {
context.Token = accessToken;
}
return Task.CompletedTask;
}
};
});
services.AddMvc();
services.AddSignalR();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment