Esempio n. 1
0
        public static string GenerateClientEndpoint(global::SyncClient.ServiceEndpoint serviceEndpoint, string hubName, string requestId)
        {
            var clientRequestId = WebUtility.UrlEncode(requestId);
            var str             = $"{serviceEndpoint.Endpoint}/client/?hub={hubName}&{Constants.QueryParameter.ConnectionRequestId}={clientRequestId}";

            return(str);
        }
Esempio n. 2
0
        public static string GenerateClientAccessToken(
            global::SyncClient.ServiceEndpoint serviceEndpoint,
            string hubName,
            IEnumerable <Claim> claims,
            TimeSpan lifetime,
            string requestId)
        {
            var audience = $"{serviceEndpoint.Endpoint}/client/?hub={hubName}";

            return(AuthenticationHelper.GenerateAccessToken(serviceEndpoint.AccessKey, audience, claims, lifetime, requestId));
        }
Esempio n. 3
0
 public SyncServer(IOptions <ServiceOptions> options, IServerNameProvider serverNameProvider)
 {
     _serverNameProvider = serverNameProvider;
     _serviceEndpoint    = new global::SyncClient.ServiceEndpoint(options.Value.ConnectionString);
 }