Last active
February 7, 2019 01:03
-
-
Save dcomartin/ee0bbaedfb60f024a45d5da27ca8383a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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