Share via


PassportIdentity.AuthUrl()

PassportIdentity.AuthUrl()

Returns a string containing the 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 Microsoft® .NET Passport authentication capabilities that are built into Microsoft® Windows® XP. The AuthURL2 method does use this functionality. For more information, see PassportIdentity.AuthURL2.

Syntax

public string AuthUrl()

Return values

Returns a URL for a user's domain and optional parameters.

Example

The following C# example displays the value of the AuthUrl() method. The default parameters specified in the Passport Manager Administration utility are used.

<%@ Page Language="C#"%>
<%@ Import Namespace = "System.Web.Security" %>
<HTML>
<HEAD><TITLE>Mysample - Exercise - CS</TITLE></HEAD>
<Script language="C#" runat="server">
 string sServer;
 string sthisURL;

 protected void Page_Load(Object src, EventArgs e) {
 sServer = Request.ServerVariables["SERVER_NAME"];
 sthisURL = "https://" + sServer + Request.ServerVariables["SCRIPT_NAME"];
 }
</Script>
<%
//Instantiate a PassportIdentity object.
PassportIdentity oMgr = (PassportIdentity)Context.User.Identity;

//LogoTag2 allows the user to sign in or out.
Response.Write ("<DIV STYLE = 'position:absolute; right:50px'>" + oMgr.LogoTag2(sthisURL,3600,true,null,1033,false,null,-1,false) + "</DIV>");

if (oMgr.GetIsAuthenticated(3600,false,false)) {
 //Display the AuthUrl return value.
 Response.Write ("<br>AuthUrl = " + oMgr.AuthUrl());
}
else {
 Response.Write("<br>You are not authenticated. Please click Sign In or exit the page.");
}
%> 

The preceding example may display output similar to the following:

AuthUrl = https://localhost/BriefCS/Default.aspx?msppchlg=1&mspplogin=
https://current-login.passport-ppe.com/login.srf%3Flc%3D1033%26id%3D23248%26ru%3D
https://localhost/BriefCS/Default.aspx%26tw%3D14400%26fs%3D1%26kv%3D1%26ct%3D1026334530%26cb%3D
co-brand-args%26ems%3D1%26ver%3D2.1.0191.1%26tpf%3D12d77d58b1cf2595ee3a15a3e9131e87

Remarks

This overloaded method returns the return URL, the .NET Passport server URL, the Site ID, the time window, and the cobranding arguments for the user.

This method returns a string that contains the URL of the calling page, plus a query string variable that contains the URL of .NET Passport Login server with parameters used by the Login server given in an encoded query string. Do not attempt to append query string information or other characters to the URL returned by AuthUrl.

This method does not redirect the user to the return URL. This URL can be used to generate a link for a user who has not signed on previously or who has an expired Ticket.

The returned values contain the values in the registry default specified in the Passport Manager Administration utility. To override the registry default values, use the overloaded AuthUrl methods, AuthUrl(string,int,bool,string,int,string,int,bool) or AuthUrl(string,int,int,string,int,string,int,int).

See Also

Passport PassportIdentity Object | PassportIdentity.AuthUrl(string,int,bool,string,int,string,int,bool) | PassportIdentity.AuthUrl(string,int,int,string,int,string,int,int)