AuthenticationServiceManager Class

Definition

配置身份验证服务的自定义实现的位置。Configures the location of a custom implementation of the authentication service.

public ref class AuthenticationServiceManager
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.EmptyStringExpandableObjectConverter))]
public class AuthenticationServiceManager
type AuthenticationServiceManager = class
Public Class AuthenticationServiceManager
Inheritance
AuthenticationServiceManager
Attributes

Remarks

类对应ScriptManager于或控件ScriptManagerProxy的属性。 AuthenticationService AuthenticationServiceManagerThe AuthenticationServiceManager class corresponds to the AuthenticationService property of the ScriptManager or ScriptManagerProxy control.

已启用 AJAX 的应用程序使用身份验证 Web 服务来登录和注销客户端脚本。The authentication Web service is used by AJAX-enabled applications to log on and log off from client script. 可以使用AuthenticationServiceManager提供身份验证 Web 服务的备用实现的路径, 而不是使用 ASP.NET 的 AJAX 功能提供的内置 Web 服务。You can use AuthenticationServiceManager to provide the path of an alternative implementation of the authentication Web service instead of using the built-in Web service that is provided by the AJAX features of ASP.NET.

若要在你的应用程序中使用身份验证服务, 你必须在配置文件中启用它。To use the authentication service in your application, you must enable it in the configuration file. 如果使用内置身份验证 Web 服务, 则无需在页面上显式声明身份验证服务管理器。If you use the built-in authentication Web service, you do not have to explicitly declare the authentication service manager on the page.

若要创建自己的身份验证服务, 必须实现一个具有两个方法的 Web Login服务Logout: 和。To create your own authentication service, you must implement a Web service that has two methods: Login and Logout. 此外, 这些方法需要内置身份验证 Web 服务的相同签名。In addition, these methods require the same signature of the built-in authentication Web service.

下面的示例演示必须在自定义身份验证 Web 服务类中实现的基本类结构。The following example shows the basic class structure that must be implemented in a custom authentication Web service class.

若要使用自定义身份验证 Web 服务, 可以通过在页的<AuthenticationService> <asp:ScriptManager>元素内包含一个元素, 在标记中以声明方式添加服务, 如下面的示例中所示。To use a custom authentication Web service, you can add the service declaratively in markup by including an <AuthenticationService> element inside the <asp:ScriptManager> element on the page, as shown in the following example.

<asp:ScriptManager ID="SM1" runat="server">  
  <AuthenticationService Path="MyAuthenticationService.asmx" />  
</asp:ScriptManager>  

你还可以通过编程Path方式将配置为使用自定义身份验证 Web 服务。You can also programmatically configure Path to use a custom authentication Web service.

无论身份验证服务的声明性部分是否在页上, 如果在配置文件中启用了身份验证服务, 则启用 AJAX 的应用程序将在呈现的页中包含 ECMAScript (JavaScript) 变量.Regardless of whether the declarative section for the authentication service is on the page, if the authentication service is enabled in the configuration file, then AJAX-enabled applications will include an ECMAScript (JavaScript) variable in the rendered page. 这允许客户端脚本确定当前用户是否已经过身份验证。This allows client script to determine whether the current user is authenticated.

Constructors

AuthenticationServiceManager()

初始化 AuthenticationServiceManager 类的新实例。Initializes a new instance of the AuthenticationServiceManager class.

Properties

Path

获取或设置身份验证服务的路径。Gets or sets the path of the authentication service.

Methods

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also