Поделиться через


Manager.LogoTag

Manager.LogoTag

The LogoTag method returns an HTML fragment containing an image tag for a Microsoft .NET Passport link. The image displays either the Sign In or Sign Out image HTML source, as appropriate.

Important  This method does not take advantage of the .NET Passport authentication capabilities that are built into Microsoft® Windows® XP. The LogoTag2 method does use this functionality. For more information, see LogoTag2.

Syntax

Function Manager.LogoTag([returnUrl], [TimeWindow], [ForceLogin], 
  		[coBrandArgs], [lang_id], [bSecure], [NameSpace], [KPP], [SecureLevel]) As String

Parameters

  • returnUrl
    Optional string representing the return URL to which to send the user upon successful sign-in. Supply a NULL value to indicate that .NET Passport should use the return URL value specified in the Passport Manager Administration utility. The return URL must be fully qualified and point to a named file, not just a directory or the server root.
  • TimeWindow
    Optional integer indicating the interval, in seconds, during which .NET Passport users must have last signed in to the calling domain. The value entered for TimeWindow must be -1, or greater than or equal to 20, and less than 2678400 (between 20 seconds and 31 days). The TimeWindow parameter is used in conjunction with the ForceLogin parameter. Pass -1 to indicate that .NET Passport should use the default value specified in the Passport Manager Administration utility.
  • ForceLogin
    Optional Boolean value that determines how the TimeWindow parameter is used. If set to True, the Login server will compare the TimeWindow interval with the time the user last manually signed in. If set to False, then TimeWindow is compared with the last time the Ticket was refreshed either silently or manually.
  • coBrandArgs
    Optional string specifying variables added to the query string for the URL of the participating site's cobranding template script page. Pass a NULL value to indicate that .NET Passport should use the default specified in the Passport Manager Administration utility.
  • lang_id
    Optional integer specifying the user's preferred Sign-in page language. Supply a NULL value to use the default specified in the Passport Manager Administration utility.
  • bSecure
    Boolean that indicates whether this page is being called from an Secure Sockets Layer (SSL) page.
  • NameSpace
    Optional string indicating a namespace to which a user without a .NET Passport is sent by the Login server. The specified namespace must appear as a "domain name" entry in the Partner.xml Component Configuration Document (CCD).
  • KPP
    Optional integer indicating data collection policies for the purpose of compliance with the parental consent requirements of children's privacy laws, such as the Children's Online Privacy Protection Act (COPPA). Supply a -1 to indicate that .NET Passport should use the default value.
  • SecureLevel
    Optional integer that determines the security level of the sign-in. For more information about the available values for SecureLevel, see Manager.IsAuthenticated.

Return values

An HTML fragment containing an image tag with a .NET Passport link. If a valid Ticket was found, the return value is a string for the Sign Out image source and HREF tag. If no Ticket was found, the return value is a string for the Sign In image source and HREF tag.

Example

The following Microsoft Visual Basic Scripting Edition (VBScript) code snippet displays several different LogoTag buttons. The LogoTag parameters are used to provide different user experiences relative to the TimeWindow, the ForceLogin, and the time since the user has last signed in.

<%@ Language=VBScript %>
<HTML>
<HEAD><TITLE>LogoTag Exercise</TITLE></HEAD>
<%
'Create a Passport Object
Set oMgr = Server.CreateObject("Passport.Manager")
thisURL = "https://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("SCRIPT_NAME")
If oMgr.IsAuthenticated Then
'Set the signout URL - return to the Default.asp
ruURL = thisURL & "/../default.asp"
Response.Write ("<br>TimeSinceSignin = " & oMgr.TimeSinceSignIn)
Response.Write ("<br>TicketAge = " & oMgr.TicketAge)
Else
'Set the sign-in URL - stay on this page
ruURL = thisURL
End If
Response.Write("<DIV STYLE = 'position:absolute; right:50px'>" & oMgr.LogoTag(ruURL,3600,FALSE) & "</DIV>")
'Set the image using the LogoTag method with the default parameters
Response.Write ("<br>LogoTag : ")
Response.Write(oMgr.LogoTag)

'Set the image using the LogoTag method with the returnUrl to this page.
Response.Write ("<br>LogoTag(thisURL) : ")
Response.Write(oMgr.LogoTag(thisURL))

'Set the image using the LogoTag method with the returnUrl to this page,
'a TimeWindow of 60 seconds, and a ForceLogin of False.
Response.Write ("<br>LogoTag(thisURL,60,False) : ")
Response.Write(oMgr.LogoTag(thisURL,60,False))

'Set the image using the LogoTag method with the returnUrl to this page,
'a TimeWindow of 60 seconds, and a ForceLogin of True.
Response.Write ("<br>LogoTag(thisURL,60,True) : ")
Response.Write(oMgr.LogoTag(thisURL,60,True))
%>
</HTML>

Remarks

The returned link displays either a sign-in or sign-out image based on the state of the cookie.

Unlike the Passport Manager object's LoginUser method, LogoTag does not have an ExtraParams parameter to override the default Cobrand Instruction Text specified during site registration.

Due to security constraints, the .NET Passport Login server user interface (UI) cannot be loaded into a frameset. It must always be the top window in the object model. Specify the target attribute with the value "_top" for any link tag that points to the Login server.

Most input parameters of the AuthURL can be specified globally as default values stored in the registry, such that a call to AuthURL could leave most input parameters blank. If values are given for any parameter, they will override the default values. Use the Passport Manager Administration utility to check or set defaults for any methods that use returnUrl, TimeWindow, ForceLogin, SecureLevel, coBrandArgs, or lang_id.

If the user has a valid Ticket and the Sign Out image is displayed, then when the user clicks the Sign Out link, he or she will be redirected first to the .NET Passport Sign-out page and then to the URL specified by vSignoutURL .

See Also

Passport Manager Object