File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 148148 . AddDownstreamApi ( InspectionService . ServiceName , builder . Configuration . GetSection ( "SARA" ) )
149149 . AddDownstreamApi ( IsarService . ServiceName , builder . Configuration . GetSection ( "Isar" ) ) ;
150150
151+ builder . Services . Configure < JwtBearerOptions > (
152+ JwtBearerDefaults . AuthenticationScheme ,
153+ options =>
154+ {
155+ options . Events ??= new JwtBearerEvents ( ) ;
156+ options . Events . OnMessageReceived = context =>
157+ {
158+ if (
159+ context . HttpContext . Request . Path . StartsWithSegments ( "/hub" )
160+ && context . Request . Query . TryGetValue ( "access_token" , out var token )
161+ )
162+ {
163+ context . Token = token ;
164+ }
165+ return Task . CompletedTask ;
166+ } ;
167+ }
168+ ) ;
169+
151170builder
152171 . Services . AddAuthorizationBuilder ( )
153172 . AddFallbackPolicy ( "RequireAuthenticatedUser" , policy => policy . RequireAuthenticatedUser ( ) ) ;
You can’t perform that action at this time.
0 commit comments