[WebService(Name="IApplicationManager",
Namespace="http://CredentialsServices",
Description="IApplicationManager is used to manage
applications. This web service is only
the definition of the interface. You
cannot invoke method calls on it.")]
abstract class IApplicationManagerShim : IApplicationManager{
public abstract void DeleteApplication(string application);
public abstract string[] GetApplications();
public abstract void DeleteAllApplications();
}
<%@ WebService Language="C#"
CodeBehind="~/App_Code/IApplicationManagerShim.cs"
Class="IApplicationManagerShim"%>
[WebServiceBinding("IRoleManager")]
interface IRoleManager{
[WebMethod(...)]
void CreateRole(string application,string role);
[WebMethod(...)]
bool DeleteRole(string application,string role,bool throwOnPopulatedRole);
[WebMethod(...)]
void AddUserToRole(string application,string userName, string role);
[WebMethod(...)]
void DeleteAllRoles(string application,bool throwOnPopulatedRole);
[WebMethod(...)]
string[] GetAllRoles(string application);
[WebMethod(...)]
string[] GetRolesForUser(string application,string userName);
[WebMethod(...)]
string[] GetUsersInRole(string application, string role);
[WebMethod(...)]
void RemoveUserFromRole(string application,string userName, string roleName);
//更多成员
}
[WebServiceBinding("IPasswordManager")]
interface IPasswordManager{
[WebMethod(...)]
bool EnablePasswordReset(string application);
[WebMethod(...)]
bool EnablePasswordRetrieval(string application);
[WebMethod(...)]
string GeneratePassword(string application,int length,
int numberOfNonAlphanumericCharacters);
[WebMethod(...)]
bool RequiresQuestionAndAnswer(string application);
[WebMethod(...)]
string ResetPassword(string application,string userName);
[WebMethod(...)]
string GetPassword(string application,string userName,string passwordAnswer);
[WebMethod(...)]
void ChangePassword(string application,string userName,string newPassword);
//更多成员
}
典型地,该策略存储在应用程序的配置文件中。该策略包括是否启动口令重置和检索,口令强度和口令回答策略等。你也可以使用IpasswordManager来生成一相应于该口令强度策略的新口令。另外,IpasswordManager可用于重置、改变或检索一指定用户的口令。
(五) IUserManager
IUserManager接口允许校验用户凭证,检索角色身份以及获取指定用户是其成员之一的所有角色。该接口用于测试和分析目的。
[WebServiceBinding("IUserManager")]
public interface IUserManager{
[WebMethod(...)]
bool Authenticate(string applicationName,string userName, string password);
[WebMethod(...)]
bool IsInRole(string applicationName,string userName, string role);
[WebMethod(...)]
string[] GetRoles(string applicationName,string userName);
}
[1] [2] [3] 下一页