Flexible-Layout Cobranding Overview
Flexible-Layout Cobranding Overview
Flexible-layout cobranding allows your site to control much of the textual content, visual layout, and styling of the service Web pages hosted by Microsoft® .NET Passport.
Important To provide users with a clear, consistent message about their personal information when they use the .NET Passport service, Microsoft requests that you do one of the following when using flexible-layout cobranding:
Link to the .NET Passport privacy statement as the only privacy statement displayed on any cobranded page.
Include the .NET Passport privacy statement language in your site's own privacy statement.
For more information about these two alternatives, see Privacy Policies and Cobranding.
Implementing Flexible-Layout Cobranding
You implement flexible-layout cobranding by creating a cobranding template file that is accessed by .NET Passport-hosted Web pages including Login, Registration, and Member Services pages. The .NET Passport servers determine the location of your cobranding template by using the URL you specify in the Cobrand URL field when registering your site. The methods of the .NET Passport Software Development Kit (SDK) that direct the user to .NET Passport hosted pages, such as LogoTag2 and LoginUser, have an optional coBrandArgs argument that lets you provide name-value pairs that are passed to your CoBrandURL at run time, allowing for more dynamic cobranding.
A .NET Passport service page always knows which site directed the user to that page. This is obtained by evaluating the Site ID parameter on the query string, which is supplied by a participating site's Passport Manager object. A .NET Passport-hosted page always calls your site's cobranding template file by specifying its URL as the src attribute of a SCRIPT tag whenever it is being viewed by a user originating from your site.
The majority of HTML, inside both the <HEAD> and <BODY> sections, that is displayed to the user in a .NET Passport service page is passed from your site's cobranding template to the calling .NET Passport page as a set of JavaScript string variables whose values are the cobranding HTML. Different pages, such as Login or Registration pages expect different variable names to be used to pass the cobranding content from your template. For a listing and explanation of the variables used by each type of page, see Cobranding Login Pages, Cobranding Registration Pages, and Cobranding Member Services Pages.
When defining the BODY section of the .NET Passport service pages, you specify the position where your site wants the .NET Passport user interface (UI) to appear by placing the "PASSPORT_UI" string token within the HTML code. Microsoft .NET Passport pages look for the "PASSPORT_UI" string token and replace it with the .NET Passport UI, and then write the entire page for display to the user by using the document.write method.
Dynamic Cobranding
There are two ways in which you can augment your cobranding template to achieve more flexible and dynamic cobranding. When a .NET Passport service page includes your site's cobranding template, it appends a query string parameter to the URL that indicates whether the page being viewed is a Login, Registration, or Member Services page and another parameter that indicates which specific service page is being accessed. You can customize the cobranding you provide based on these contextual parameters. For more information, see Context-Sensitive Cobranding.
You can also use the Passport Manager object to supply your own query string variables to your cobranding template. This allows you to customize cobranding in an arbitrary way, based on logic specific to your site. For more information, see Using the coBrandArgs Parameter for Flexible-Layout Cobranding.
Static vs. Dynamic Cobranding Templates
If you choose not to use any of the query string parameters to dynamically modify your cobranding HTML content, then you can simply use a static Javascript file that contains the appropriate variable definitions. Otherwise, you should use an Active Server Pages (ASP) page to dynamically create the variable definitions and pass them back to the calling page using the Response.Write method. For examples of these two techniques, see Basic Cobranding Template and Flexible-Layout Cobranding Example.
Remarks
The following are notes about flexible-layout cobranding.
- On Microsoft® Windows® XP only, Joint Photographic Experts Group (JPEG) images are not supported.
- If you are serving a static file, the file extension should typically be ".js" to ensure that it is handled as a script file in all cases.
- The cobranding template cannot be a zero-byte or missing file; these conditions will cause a fault in some Netscape browsers when they attempt to render .NET Passport network pages that use cobranding.
- Pages that are served by secure (HTTPS) protocol use the same cobranding template mechanism for cobranding information. If your site either uses HTTPS on its own pages or accesses HTTPS pages on the .NET Passport network, the cobranding templates hosted by your site must also be able to be served HTTPS. Otherwise, mixed-content messages will be displayed on client browsers. The following are some specific requirements related to HTTPS:
- All images called from an HTTPS page should be served HTTPS.
- The actual cobranding template file location specified on initial registration (CoBrandURL) should originally have been specified as an HTTP URL. For HTTPS pages, that same file must also be accessible through HTTPS at that same path, because the network page in question will manipulate the URL you gave as a cobranding template URL and will call the HTTPS equivalent URL for your cobranding template at the time of request.
- Any elements called within the fields or variables used for cobranding on an HTTPS page must also be served HTTPS. This requires that either the HTTP and HTTPS versions of the cobranding template point to non-SSL or SSL files respectively if you use static cobranding template files or the cobranding template code itself is capable of detecting whether it is being called as an SSL or non-SSL URL and changes the element URLs to match this setting when the template generates the final JavaScript variables. This is another good reason to use server-interpreted languages to create the cobranding template instead of relying on a static .js file.
See Also