private SignalRConnectionInfo GetClientConnectionInfo(SignalRConnectionInfoAttribute attribute)
        {
            var signalR = new AzureSignalRClient(attribute.ConnectionStringSetting, httpClient);
            var claims  = attribute.GetClaims();

            return(signalR.GetClientConnectionInfo(attribute.HubName, claims));
        }
Пример #2
0
        private IAsyncCollector <SignalRMessage> CreateCollector(SignalRAttribute attribute)
        {
            var connectionString = FirstOrDefault(attribute.ConnectionStringSetting, options.ConnectionString);
            var hubName          = FirstOrDefault(attribute.HubName, options.HubName);
            var client           = new AzureSignalRClient(connectionString, httpClientFactory.CreateClient());

            return(new SignalRMessageAsyncCollector(client, hubName));
        }
Пример #3
0
        public async Task <NegotiationContext> ConvertAsync(
            SignalRNegotiationAttribute input, CancellationToken cancellationToken)
        {
            var serviceHubContext = await _serviceManagerStore
                                    .GetOrAddByConnectionStringKey(input.ConnectionStringSetting)
                                    .GetAsync(input.HubName) as IInternalServiceHubContext;

            var endpoints = serviceHubContext.GetServiceEndpoints();
            var endpointConnectionInfo = await Task.WhenAll(endpoints.Select(async e =>
            {
                var subHubContext      = serviceHubContext.WithEndpoints(new ServiceEndpoint[] { e });
                var azureSignalRClient = new AzureSignalRClient(subHubContext);
                var connectionInfo     = await azureSignalRClient.GetClientConnectionInfoAsync(input.UserId, input.IdToken, input.ClaimTypeList, null);
                return(new EndpointConnectionInfo(e)
                {
                    ConnectionInfo = connectionInfo
                });
            }));

            return(new NegotiationContext {
                Endpoints = endpointConnectionInfo
            });
        }
Пример #4
0
        private SignalRConnectionInfo GetClientConnectionInfo(SignalRConnectionInfoAttribute attribute)
        {
            var signalR = new AzureSignalRClient(StaticServiceHubContextStore.ServiceHubContextStore, serviceManager);

            return(signalR.GetClientConnectionInfo(attribute.HubName, attribute.UserId, attribute.IdToken, attribute.ClaimTypeList));
        }
Пример #5
0
        private SignalRConnectionInfo GetClientConnectionInfo(SignalRConnectionInfoAttribute attribute)
        {
            var signalR = new AzureSignalRClient(attribute.ConnectionStringSetting, httpClientFactory.CreateClient());

            return(signalR.GetClientConnectionInfo(attribute.HubName));
        }