次の方法で共有


Manager.LogoTag2

Manager.LogoTag2

The LogoTag2 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 takes advantage of the .NET Passport authentication capabilities that are built into Microsoft® Windows® XP. If you use this method to generate the Sign In button on a Web page, users who are using Microsoft® Internet Explorer 6 on Windows XP will enter their credentials into the .NET Passport sign-in user interface (UI) that is integrated into the operating system. As a result, any customized cobranding you supply will not be displayed. If you want to ensure that all users sign in using the cobranding-enabled Web UI, use the LogoTag method. For more information, see Manager.LogoTag.

Syntax

Function Manager.LogoTag2([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 a 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 LogoTag2 buttons. The LogoTag2 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>LogoTag2 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.LogoTag2(ruURL,3600,FALSE) & "</DIV>")
'Set the image using the LogoTag2 method with the default parameters
Response.Write ("<br>LogoTag2 : ")
Response.Write(oMgr.LogoTag2)

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

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

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

Remarks

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

This method supersedes LogoTag. However, LogoTag is maintained for backward compatibility. New users are advised to use LogoTag2.

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

See Also

Passport Manager Object