 Rank: Administration Medals:  Joined: 3/28/2014(UTC) Posts: 2,862  Thanks: 3 times Was thanked: 351 time(s) in 303 post(s)
|
So this URI is specific to the relay itself, ie our protocol for session control/communication. If you want to create a clickable link that exists somewhere else on the web you'll want to create an Extension that is able to generate this list of "Client Launch Parameters" specific to the session and user requesting it. There's a decent breakdown of the Client Launch Parameters themselves on our KB, specifically here.The ScreenConnector Extension creates a Service.ashx file which contains a method that you can pretty much just copy into your own extension, also shown here: Code:
public object GetLaunchUrl(string sessionName)
{
var permissionEntries = Permissions.GetEntriesForUser();
Permissions.AssertAnyPermission(permissionEntries);
var sessionFilter = ServerExtensions.GetExpression("Name", "=", sessionName);
var relayUri = ServerExtensions.GetRelayUri(ConfigurationManager.AppSettings, HttpContext.Current.Request.Url, true, true);
var userDisplayName = FormsAuthenticationModule.GetUserDisplayNameWithFallback(HttpContext.Current.User);
var variables = ServerExtensions.GetStandardVariables(userDisplayName);
var handlerUrl = ServerExtensions.GetWebServerUri(ConfigurationManager.AppSettings, HttpContext.Current.Request.Url, true, true) + WebConfigurationManager.GetHandlerPath(typeof(ClickOnceDirectHandler)).ReplaceFirst("*", WebResources.GetString("FileDownload.BaseName"));
return
(from session in SessionManagerPool.Demux.GetSessions(sessionFilter)
from groupContainingSession in SessionManagerPool.Demux.GetSessionGroupsContainingSession(session.SessionID, variables)
where Permissions.HasPermission(new SessionPermissionRequest { Name = PermissionInfo.ViewSessionGroupPermission, SessionType = session.SessionType, SessionGroupName = groupContainingSession }, permissionEntries)
let sessionPermissions = PermissionInfo.GetSessionPermissions(permissionEntries, session.SessionType, groupContainingSession, session.Host == userDisplayName)
select new ClientLaunchParameters
{
Host = relayUri.Host,
Port = relayUri.Port,
EncryptionKey = ServerCryptoManager.Instance.PublicKey,
SessionType = session.SessionType,
SessionID = session.SessionID,
ProcessType = ProcessType.Host,
SessionTitle = session.Name,
AccessToken = ServerCryptoManager.Instance.GetAccessToken(session.SessionID, ProcessType.Host, userDisplayName, sessionPermissions, default(DateTime)),
})
.FirstOrDefault()
.SafeNav(clp => handlerUrl + ClientLaunchParameters.ToQueryString(clp));
}
You pass it the Name of a session and it joins the first one it finds with that list. It might be better to change it to use the SessionID but that's up to you. It also pulls authentication from the webrequest itself but you can always change that to use an API token or something similar. |