Instantly share code, notes, and snippets.

@dcomartin dcomartin/startup.cs
Last active Feb 7, 2019

Embed
What would you like to do?
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