本文整理汇总了C#中IFormsAuthenticationService类的典型用法代码示例。如果您正苦于以下问题:C# IFormsAuthenticationService类的具体用法?C# IFormsAuthenticationService怎么用?C# IFormsAuthenticationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFormsAuthenticationService类属于命名空间,在下文中一共展示了IFormsAuthenticationService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AccountController
public AccountController(IFormsAuthenticationService formsService, IMembershipService membershipService, IUserService userService, IMasterService masterService)
{
this.formsService = formsService;
this.membershipService = membershipService;
this.userService = userService;
this.masterService = masterService;
}
示例2: GetUserFriendlyName
/// <summary>
/// Return how we want to display the user's name in the UI. Currently set to Username, could be changed to First/Last, etc,
/// </summary>
/// <param name="FormsAuthService"></param>
/// <returns></returns>
public static string GetUserFriendlyName(IFormsAuthenticationService FormsAuthService)
{
return HttpContext.Current.Cache.GetOrStore<string>(
GetUserSignInKey(FormsAuthService, UserFriendlyNameKey),
() =>
{
if (FormsAuthService.IsAuthenticated())
{
using (SiteDB db = new SiteDB())
{
var user = UserRepository.GetUser(db, FormsAuthService.GetCurrentUserId());
if (user != null)
{
return user.Username;
}
else
{
return "";
}
}
}
else
{
return "";
}
}
);
}
示例3: HomeController
public HomeController(ISession session, IFormsAuthenticationService FormsAuthService)
{
_session = session;
_userRepository = new UserRepository(_session);
this.FormsAuthService = FormsAuthService;
}
示例4: PivotalTrackerApi
public PivotalTrackerApi(IFormsAuthenticationService formsAuthenticationService )
{
this.formsAuthenticationService = formsAuthenticationService;
//user = new PivotalUser(Configuration.PivotalApiToken);
user = new PivotalUser(this.formsAuthenticationService.ApiToken());
}
示例5: AccountController
public AccountController(IDbContext dbContext, IRepresentativeUserService representativeUserService, IFormsAuthenticationService formsAuthentication, IUserService userService)
{
_dbContext = dbContext;
_representativeUserService = representativeUserService;
_formsAuthentication = formsAuthentication;
_userService = userService;
}
示例6: AccountController
// This constructor is not used by the MVC framework but is instead provided for ease
// of unit testing this type. See the comments in AccountModels.cs for more information.
public AccountController(IFormsAuthenticationService formsService,
IMembershipService membershipService)
{
FormsService = formsService ?? new FormsAuthenticationService();
MembershipService = membershipService ??
new AccountMembershipService();
}
示例7: AuthenticationController
public AuthenticationController(
IFormsAuthenticationService formsAuthService,
IUserService userService)
{
FormsAuth = formsAuthService;
UserService = userService;
}
示例8: GetUserFriendlyName
/// <summary>
/// Return how we want to display the user's name in the UI. Currently set to Username, could be changed to First/Last, etc,
/// </summary>
/// <param name="FormsAuthService"></param>
/// <returns></returns>
public static string GetUserFriendlyName(IFormsAuthenticationService FormsAuthService)
{
return HttpContext.Current.Cache.GetOrStore<string>(
GetUserSignInKey(FormsAuthService, UserFriendlyNameKey),
() =>
{
if (FormsAuthService.IsAuthenticated())
{
var userRepository = new UserRepository(MvcApplication.SessionFactory.OpenSession());
var user = userRepository.GetUser(FormsAuthService.GetCurrentUserName());
if (user != null)
{
return user.Username;
}
else
{
return "";
}
}
else
{
return "";
}
}
);
}
示例9: LangController
public LangController(
IUserService userService,
IFormsAuthenticationService formsAuthenticationService)
: base(userService, formsAuthenticationService)
{
}
示例10: UserController
public UserController(IUnitOfWork uow, IUserService userService, IRoleService roleService, IFormsAuthenticationService formsAuthenticationService)
{
_uow = uow;
_userService = userService;
_roleService = roleService;
_formsAuthenticationService = formsAuthenticationService;
}
示例11: AccountController
public AccountController(
IFormsAuthenticationService formsAuthenticationService,
MySettings mySettings)
{
_formsAuthenticationService = formsAuthenticationService;
_mySettings = mySettings;
}
示例12: UserController
public UserController(
IUserService userService,
IFormsAuthenticationService formsAuthenticationService)
{
_formsAuthenticationService = formsAuthenticationService;
_userService = userService;
}
示例13: AuthenticationController
public AuthenticationController(
IFormsAuthenticationService formsAuthSvc,
IUserService userSvc)
{
this.formsAuthSvc = formsAuthSvc;
this.userSvc = userSvc;
}
示例14: AccountController
/// <summary>
/// Initializes a new instance of the <see cref="AccountController"/> class.
/// </summary>
/// <param name="formsAuthenticationService">The forms authentication service.</param>
/// <param name="membershipService">The membership service.</param>
public AccountController(
IFormsAuthenticationService formsAuthenticationService,
IMembershipService membershipService)
{
this.MembershipService = membershipService;
this.FormsService = formsAuthenticationService;
}
示例15: BCProxyLoginController
public BCProxyLoginController(IPortalUserFacade portalUserFacade, ILoginService loginService, IFormsAuthenticationService formsAuthenticationService, IPortletTemplateFacade portletTemplateFacade)
{
_loginService = loginService;
_formsAuthenticationService = formsAuthenticationService;
_portletTemplateFacade = portletTemplateFacade;
_portalUserFacade = portalUserFacade;
}