Share via


Manager.AuthURL2

Manager.AuthURL2

The AuthURL2 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 takes advantage of the .NET Passport authentication capabilities that are built into Microsoft® Windows XP. If you use this method to generate a link to the Login server, 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 AuthURL method. For more information, see AuthURL.

Syntax

Function Manager.AuthURL2([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 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 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 AuthURL2 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 AuthURL2 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 AuthURL2 method with the default parameters
  Response.Write ("<br>AuthURL2: ")
  Response.Write ("<br>" & oMgr.AuthURL2)

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

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

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

Remarks

The AuthURL2 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 AuthURL2.

This method supersedes AuthURL. However, AuthURL is maintained in the SDK for backward compatibility. New users are advised to use AuthURL2.

See Also

Passport Manager Object