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


Manager.AuthURL

Manager.AuthURL

The AuthURL method returns a string containing the Microsoft® .NET Passport Login server URL for a user's domain, as well as optional information sent to the Login server in the query string.

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

Syntax

Function Manager.AuthURL([returnUrl], [TimeWindow], [ForceLogin], [coBrandArgs], [lang_id], [NameSpace], [KPP], [SecureLevel])

Parameters

  • returnUrl
    Optional string. This parameter represents the return URL to which to return the user upon a successful sign-in or sign-out. Calling this method sets the URL of the location to which the Login server should redirect users. Pass a NULL value to indicate that .NET Passport should use the default value specified in the application. The return URL must be fully qualified and point to a named file, not just a root. If SecureLevel is set to True, returnUrl must be an HTTPS URL.
  • TimeWindow
    Optional integer. This parameter specifies the interval during which users must have last signed in to the calling domain. The value entered for TimeWindow must be greater than or equal to 20 and less than 2678400 (between 20 seconds and 31 days).
  • ForceLogin
    Optional Boolean value. This parameter determines how the TimeWindow parameter gets used. If set to True, the Login server will compare TimeWindow interval against the time since the user last manually signed in. If set to False, then the Login server will compare TimeWindow against the last time the Ticket was refreshed, either silently or manually.
  • coBrandArgs
    Optional string. This parameter specifies variables to be appended as query string arguments to the URL of the participating site's cobranding template script page.
  • lang_id
    Optional integer value. This parameter specifies the language used for the Sign-in page that is displayed to the user.
  • NameSpace
    Optional string. This parameter indicates a namespace to which a user without a .NET Passport is directed by the Login server. Pass a NULL value to indicate that .NET Passport should use the default. The specified namespace must appear as a "domain name" entry in the Partner.xml Component Configuration Document (CCD).
  • KPP
    Optional integer. This parameter specifies 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). Pass -1 to indicate that .NET Passport should use the default value. 
  • SecureLevel
    Optional Boolean value. This parameter indicates whether the actual sign-in user interface (UI) should be served via HTTPS from the .NET Passport domain authority. Set to False to indicate that .NET Passport should use the default value.

Return values

The AuthURL method returns a URL used for sign-in on the user's domain and optional parameters.

Example

The following Microsoft Visual Basic Scripting Edition (VBScript) code snippet calls the AuthURL method.

...
Dim oMgr
Set oMgr = Server.CreateObject("Passport.Manager")
thisURL = "https://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("SCRIPT_NAME")

If oMgr.IsAuthenticated(3600,True,False) Then
  'Display the AuthURL method with the default parameters
  Response.Write ("<br>AuthURL: ")
  Response.Write ("<br>" & oMgr.AuthURL)

  'Display the AuthURL method with the returnUrl to this page.
  Response.Write ("<br><br>AuthURL(thisURL) : ")
  Response.Write ("<br>" & oMgr.AuthURL(thisURL))

  'Display the AuthURL method with the returnUrl to this page,
  'the TimeWindow set to 3600, and the ForceLogin set to True.
  Response.Write ("<br><br>AuthURL(thisURL,3600,True)) : ")
  Response.Write ("<br>" & oMgr.AuthURL(thisURL,3600,True))

  'Display the AuthURL method with the returnUrl to this page,
  'and the lang_id set to 4015.
  Response.Write ("<br><br>AuthURL(thisURL,,,,4015)) : ")
  Response.Write ("<br>" & oMgr.AuthURL(thisURL,,,,4015))
Else
  Response.Write ("<br>You have not been authenticated within the last hour. Please sign in or exit.")
End If
...

Remarks

The AuthURL method provides the return URL, the .NET Passport server URL, the Site ID, the time window, the cobranding arguments, and other parameters for the current user in an encoded string. Do not attempt to append query string information or other characters to the URL returned by AuthURL.

Due to security constraints, the .NET Passport Login server 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.

Any request to the Login server includes the local (server clock) time on the query string. New timestamps are established relative to that local time. Local time is established once the page is rendered. The exact time that a user actually clicks the link cannot be determined through Passport Manager methods.

See Also

Passport Manager Object