First published on CloudBlogs on Dec, 17 2009
In our earlier blog post, we introduced RemoteApp and Desktop Connections to enable users to have their RemoteApp and Desktop icons integrated on their Windows 7 start menu. RemoteApp and Desktop Connections works with this new feature of Remote Desktop Web Access (RD Web Access)--the RemoteApp and Desktop Connection feed. This RemoteApp and Desktop Connection feed provides significant extensibility to partners and customers in presenting remote resources in various ways. The connection feed feature contains information about published remote resources (e.g. RDP files and their associated icon and image files) in a software-parsable XML format.
On Remote Desktop Web Access (RD Web Access) Server, there are two URLs available to serve the connection feed. You need to choose one depending on the extensibility scenario.
-
“/rdweb/pages/webfeed.aspx” URL:
This URL is used for RD Web Access website extensibility. You can create a new web page similar to the RD Web Access default webpage. Below are some of the features that are possible by using this URL
- Branding or customizations for your customers or organization.
- Visually sorting or segregating remote resource types (e.g. RemoteApp and Remote Desktop resources).
- Filtering remote resources at display time (for example, additional filtering apart from RemoteApp filtering ).
- Silverlight-based webpage for a rich user experience.
By using this connection feed URL
- There is no need to write a custom authentication mechanism because the webpage runs within the RD Web Access web application.
- It is easier to support Single Sign On for launching remote resources. In a future post, we will cover on how to enable SSO.
-
“/rdweb/feed/webfeed.aspx” URL:
This URL can also be used to provide extensibility and is more flexible than the above URL. In addition to above feature set, below are some of the other features that are possible by using this URL:
- Creating new client applications similar to RemoteApp and Desktop Connections for downlevel windows clients and for thin clients.
- Creating new web portal similar to RD Web Access, not just a webpage alone.
- Integrating remote resource presentation with your existing web portal.
By using this connection feed URL
- Client applications get an authentication cookie that will not expire. This can be used for easier automatic updates without re-prompting user for credentials.
Here is a sample connection XML containing information about remote resources:
<?xml version="1.0" encoding="utf-8"?> <ResourceCollection PubDate="2009-07-09T17:57:30.323Z" SchemaVersion="1.1" xmlns="http://schemas.microsoft.com/ts/2007/05/tswf"> <Publisher LastUpdated="2009-07-09T17:57:12.588625Z" Name ="Remote Desktop Services Default Connection" ID="Contoso" Description=""> <Resources> <Resource ID="60fb077b94a241a473cf982140337213e4d93177" Alias ="mspaint" Title ="Paint" LastUpdated="2009-07-09T17:57:12.588625Z" Type ="RemoteApp" ExecutableName="mspaint.exe"> <Icons> <IconRaw FileType="Ico" FileURL ="/RDWeb/Pages/rdp/mspaint032x32.ico" /> <Icon32 Dimensions="32x32" FileType="Png" FileURL ="/RDWeb/Pages/rdp/mspaint032x32.png" /> </Icons> <FileExtensions /> <HostingTerminalServers> <HostingTerminalServer> <ResourceFile FileExtension =".rdp" URL ="/RDWeb/Pages/rdp/Contoso-mspaint.rdp" /> <TerminalServerRef Ref="Contoso" /> </HostingTerminalServer> </HostingTerminalServers> </Resource> </Resources> <TerminalServers> <TerminalServer ID="Contoso" Name="Contoso" LastUpdated="2009-07-09T17:57:12.588625Z" /> </TerminalServers> </Publisher> </ResourceCollection> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }The bolded attributes in the connection provide information about the remote resources. The schema file for the connection is located at %windir%schemastsworkspacetswf.xsd in Windows Server 2008 R2 or on a Window 7 client machine.
Website extensibility: Using the connection to create a new web pageFollowing is a code sample in C# (ASP.NET) on how to use the connection to create a new web page as demonstrated at PDC 2008 . This code sample uses a connection at the “/rdweb/pages/webfeed.aspx” location. Below are the steps that need to complete in creating the new web page.
- In Page PreInit, check for user authentication. If the user is not authenticated, redirect the request to the login page.
- In Page Load, get the connection by calling Server.Execute on the webfeed.aspx page.
- Parse the connection XML to get information on the remote resources. Use this information to present remote resources in your customized way.
- Replace the default.aspx at %windir%WebRDWebPagesen-US folder with this newly created page. This webpage will run inside the RD Web Access web application using an out-of-the box authentication mechanism.
Notes on this sample code:
- It does not show how to enable RemoteApp and Desktop Connection’s Single Sign On feature.
- It does not show how to differentiate the page content between the admin and a regular user.
- It assumes that application locale is en-US.
The sample page will appear as below.
Customized client applications: Using the connection to create a new client application
Following is a code sample in C# on how to use the connection to create a client application. This code sample uses the connection at the “/rdweb/feed/webfeed.aspx” location.
- Send request to the connection URL page with auto-redirect enabled along with user credentials. The connection URL uses cookie-based authentication, so this initial request sent to the connection URL will be redirected to the login page. The login page, which uses Windows-based authentication, responds with the authentication cookie. The supplied user credentials in the request will be used in RemoteApp filtering .
- Cache the authentication cookie for all subsequent requests. The cookie will not expire, so you can also reuse the same cookie for easy automatic connection updating without prompting the user for credentials.
- Send the request to the connection URL with the authentication cookie, and get the connection XML in response.
- Parse the connection XML, and download subsequent resource files and their associated icon and image files.
As shown above, RemoteApp and Desktop Connection provides an easy way to customize the standard look and feel of RD Web Access or to present remote resources in new ways.
Published Sep 07, 2018
Version 1.0MicrosoftSecurityandComplianceTeam
Iron Contributor
Joined September 05, 2018
Microsoft Security Community Blog
Follow this blog board to get notified when there's new activity