Ejemplo n.º 1
0
 public BrowserHub(
     IForwardingClient <PayloadType, string> forwardingClient,
     ConnectionManager connectionManager,
     IUserService userService)
 {
     this.connectionManager = connectionManager;
     this.forwardingClient  = forwardingClient;
     this.userService       = userService;
 }
Ejemplo n.º 2
0
 public static void ForwardMsal(HttpRequest request, IForwardingClient client)
 {
     Forward(
         request: request,
         client: client,
         headerName: XMsalAuthTokenHeader,
         headerForwardedName: AuthorizationHeader,
         prependedText: "Bearer ");
 }
Ejemplo n.º 3
0
        public static void Forward(HttpRequest request, IForwardingClient client, string headerName, string headerForwardedName, string prependedText = "")
        {
            StringValues authToken = StringValues.Empty;

            request.Headers.TryGetValue(headerName, out authToken);

            if (authToken.Any())
            {
                client.ForwardHeader(headerForwardedName, $"{prependedText}{authToken.First()}").Wait();
            }
        }
Ejemplo n.º 4
0
        public SetupForwarding(
            IHubContext <BrowserHub, BrowserHub.IBrowserClient> hubContext,
            IForwardingClient <PayloadType, string> forwardingClient,
            ConnectionManager connectionManager)
        {
            this.hubContext       = hubContext;
            this.forwardingClient = forwardingClient;
            this.forwardingClient.Start();
            this.connectionManager = connectionManager;

            this.Configure();
        }