Exemple #1
0
        private Task ProcessNegotiationRequest(HostContext context)
        {
            var claims = BuildClaims(context);

            // Redirect to Service
            var url         = _endpoint.GetClientEndpoint();
            var accessToken = _endpoint.GenerateClientAccessToken(claims);

            return(SendJsonResponse(context, GetRedirectNegotiateResponse(url, accessToken)));
        }
        public NegotiationResponse Process(HttpContext context, string hubName)
        {
            var claims       = BuildClaims(context);
            var request      = context.Request;
            var originalPath = GetOriginalPath(request.Path);

            return(new NegotiationResponse
            {
                Url = _endpointProvider.GetClientEndpoint(hubName, originalPath,
                                                          request.QueryString.HasValue ? request.QueryString.Value.Substring(1) : string.Empty),
                AccessToken = _endpointProvider.GenerateClientAccessToken(hubName, claims),
                // Need to set this even though it's technically protocol violation https://github.com/aspnet/SignalR/issues/2133
                AvailableTransports = new List <AvailableTransport>()
            });
        }
Exemple #3
0
 public string GetClientEndpoint(string hubName)
 {
     return(_endpointProvider.GetClientEndpoint(hubName, null, null));
 }
Exemple #4
0
 public string GetClientEndpoint(string hubName)
 {
     return(_endpointProvider?.GetClientEndpoint(hubName, null, null) ?? throw new InvalidOperationException(EmptyConnectionStringMessage));
 }