Share via


PassportIdentity.LoginUser

PassportIdentity.LoginUser

Logs the user on, either by outputting a 302 redirect URL, or initiating a Microsoft .NET Passport-aware client authentication exchange.

Syntax

public int LoginUser()
    

Return values

An integer result code.

Example

The following C# example uses LoginUser() to authenticate a user. Upon a successful sign-in, the user is redirected to the page specified in the Passport Manager Administration utility.

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

 protected void Page_Load(Object src, EventArgs e) {
  oMgr = (PassportIdentity)User.Identity;
 }
</Script>
<%
//Sign the user in and return to the page specified in the Passport Manager Administration utility.
oMgr.LoginUser();
%>
</HTML>

Remarks

This method initiates the sign-in process, which requires the user to sign in using the e-mail address and password and logs the user as an authenticated .NET Passport client. If the user is already signed in, no additional sign-in is required.

See Also

Passport PassportIdentity Object