本文整理汇总了C#中IAuthentication类的典型用法代码示例。如果您正苦于以下问题:C# IAuthentication类的具体用法?C# IAuthentication怎么用?C# IAuthentication使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAuthentication类属于命名空间,在下文中一共展示了IAuthentication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BaseController
public BaseController()
{
_mail = new MailSandler();
_repository = DependencyResolver.Current.GetService<IRepository>();
_mapper = DependencyResolver.Current.GetService<IMapper>();
_auth = DependencyResolver.Current.GetService<IAuthentication>();
}
示例2: InstitutionsController
public InstitutionsController(IInstitutionRepository institutionRepository, IBaseScoreCardRepository baseScoreCardRepository, IValuationScoreCardRepository valuationScoreCardRepository, IUserProfileRepository userProfileRepository, IAuthentication authentication)
: base(baseScoreCardRepository, valuationScoreCardRepository, userProfileRepository, authentication)
{
Requires.NotNull(institutionRepository, nameof(institutionRepository));
this.institutionRepository = institutionRepository;
}
示例3: AdminBaseController
public AdminBaseController( IAuthentication authentication = null)
{
// Allows us to injects a IUserHelper in unit tests
Authentication = authentication ?? DependencyManager.Authentication;
}
示例4: LogOn
/// <summary>
/// Logs on with specified authentication method.
/// </summary>
/// <param name="authentication">The authentication method.</param>
/// <returns></returns>
/// <exception cref="System.InvalidOperationException">
/// Already logged on
/// or
/// Another unfinished log on/off request exists.
/// </exception>
/// <exception cref="System.Exception">Null user info is not allowed</exception>
public async Task LogOn(IAuthentication authentication)
{
if (UserInfo != null)
{
throw new InvalidOperationException("Already logged on");
}
if (Interlocked.CompareExchange(ref IsWorking, 1, 0) == 0)
{
try
{
var result = await authentication.Authenticate();
if (result == null)
{
throw new Exception("Null user info is not allowed");
}
UserInfo = result;
ServerConnection.AccessToken = UserInfo.AccessToken;
return;
}
finally
{
Interlocked.CompareExchange(ref IsWorking, 0, 1);
}
}
throw new InvalidOperationException("Another unfinished log on/off request exists.");
}
示例5: BaseController
public BaseController(IDb db, ILogger logger, IAuthentication authentication = null)
{
Db = db;
Logger = logger;
Authentication = authentication ?? DependencyManager.Authentication;
}
示例6: FeaturedController
public FeaturedController(IUserService userService, IAuthentication authentication, IListingService listingService, IFeaturedService featuredService)
{
_userService = userService;
_authentication = authentication;
_listingService = listingService;
_featuredService = featuredService;
}
示例7: MapModule
public MapModule(IRegionManager regionManager, IAuthentication authentication, IEventAggregator eventAggregator)
{
this.regionManager = regionManager;
this.authentication = authentication;
if (eventAggregator != null)
eventAggregator.GetEvent<CompositePresentationEvent<LogonData>>().Subscribe(OnLogonChanged);
}
示例8: PromotionController
public PromotionController(IUserService userService, IAuthentication authentication, IListingService listingService, IPromotionService promotionService)
{
_userService = userService;
_authentication = authentication;
_listingService = listingService;
_promotionService = promotionService;
}
示例9: QoamCornersController
public QoamCornersController(IBaseScoreCardRepository baseScoreCardRepository, IValuationScoreCardRepository valuationScoreCardRepository, IUserProfileRepository userProfileRepository, IAuthentication authentication, IJournalRepository journalRepository, ICornerRepository cornerRepository, IBulkImporter<CornerToImport> bulkImporter)
: base(baseScoreCardRepository, valuationScoreCardRepository, userProfileRepository, authentication)
{
_journalRepository = journalRepository;
_cornerRepository = cornerRepository;
_bulkImporter = bulkImporter;
}
示例10: AdminController
public AdminController(JournalsImport journalsImport, UlrichsImport ulrichsImport, DoajImport doajImport, JournalTocsImport journalsTocImport, JournalsExport journalsExport, IJournalRepository journalRepository, IUserProfileRepository userProfileRepository, IAuthentication authentication, IInstitutionRepository institutionRepository, IBlockedISSNRepository blockedIssnRepository, IBaseScoreCardRepository baseScoreCardRepository, IValuationScoreCardRepository valuationScoreCardRepository, IBulkImporter<SubmissionPageLink> bulkImporter, IBulkImporter<Institution> institutionImporter)
: base(baseScoreCardRepository, valuationScoreCardRepository, userProfileRepository, authentication)
{
Requires.NotNull(journalsImport, nameof(journalsImport));
Requires.NotNull(ulrichsImport, nameof(ulrichsImport));
Requires.NotNull(journalsTocImport, nameof(journalsTocImport));
Requires.NotNull(doajImport, nameof(doajImport));
Requires.NotNull(journalsExport, nameof(journalsExport));
Requires.NotNull(journalRepository, nameof(journalRepository));
Requires.NotNull(institutionRepository, nameof(institutionRepository));
Requires.NotNull(blockedIssnRepository, nameof(blockedIssnRepository));
Requires.NotNull(bulkImporter, nameof(bulkImporter));
Requires.NotNull(institutionImporter, nameof(institutionImporter));
this.journalsImport = journalsImport;
this.ulrichsImport = ulrichsImport;
this.doajImport = doajImport;
_journalsTocImport = journalsTocImport;
this.journalsExport = journalsExport;
this.journalRepository = journalRepository;
this.institutionRepository = institutionRepository;
this.blockedIssnRepository = blockedIssnRepository;
_bulkImporter = bulkImporter;
_institutionImporter = institutionImporter;
}
示例11: TextClient
/// <summary>
///
/// </summary>
/// <param name="authentication"></param>
/// <param name="hasCommentary"></param>
/// <param name="hasContext"></param>
public TextClient(IAuthentication authentication, bool hasCommentary, bool hasContext)
: base(authentication)
{
_authentication = authentication;
HasCommentary = hasCommentary;
HasContext = hasContext;
}
示例12: BillingViewModelBuilder
public BillingViewModelBuilder(CheckoutDetailsModel checkoutDetailsModel, IAuthentication authentication,ICustomerAccountService accountService, IMappingEngine mapper)
{
this.checkoutDetailsModel = checkoutDetailsModel;
this.authentication = authentication;
this.accountService = accountService;
this.mapper = mapper;
}
示例13: ChangeAuthentication
/// <summary>
/// Updates the authentication that this Client uses.
/// </summary>
/// <param name="authentication">The authentication to put into this Client.</param>
public void ChangeAuthentication(IAuthentication authentication)
{
if (authentication.AuthenticationType != AuthenticationType.ClientId)
throw new NotImplementedException();
Authentication = authentication;
}
示例14: HttpAuth
public HttpAuth(
IPrincipalFactory principalFactory,
IAuthentication authentication)
{
this.PrincipalFactory = principalFactory;
this.Authentication = authentication;
}
示例15: ScoreController
public ScoreController(IBaseScoreCardRepository baseScoreCardRepository, IBaseJournalPriceRepository baseJournalPriceRepository, IValuationScoreCardRepository valuationScoreCardRepository, IValuationJournalPriceRepository valuationJournalPriceRepository, IScoreCardVersionRepository scoreCardVersionRepository, IJournalRepository journalRepository, ILanguageRepository languageRepository, ISubjectRepository subjectRepository, IQuestionRepository questionRepository, GeneralSettings generalSettings, IUserProfileRepository userProfileRepository, IInstitutionRepository institutionRepository, IAuthentication authentication)
: base(userProfileRepository, authentication)
{
Requires.NotNull(baseScoreCardRepository, "baseScoreCardRepository");
Requires.NotNull(baseJournalPriceRepository, "baseJournalPriceRepository");
Requires.NotNull(valuationScoreCardRepository, "valuationScoreCardRepository");
Requires.NotNull(valuationJournalPriceRepository, "valuationJournalPriceRepository");
Requires.NotNull(scoreCardVersionRepository, "scoreCardVersionRepository");
Requires.NotNull(journalRepository, "journalRepository");
Requires.NotNull(languageRepository, "languageRepository");
Requires.NotNull(subjectRepository, "keywordRepository");
Requires.NotNull(questionRepository, "questionRepository");
Requires.NotNull(institutionRepository, "institutionRepository");
Requires.NotNull(generalSettings, "generalSettings");
this.baseScoreCardRepository = baseScoreCardRepository;
this.scoreCardVersionRepository = scoreCardVersionRepository;
this.valuationJournalPriceRepository = valuationJournalPriceRepository;
this.valuationScoreCardRepository = valuationScoreCardRepository;
this.journalRepository = journalRepository;
this.languageRepository = languageRepository;
this.subjectRepository = subjectRepository;
this.questionRepository = questionRepository;
this.baseJournalPriceRepository = baseJournalPriceRepository;
this.institutionRepository = institutionRepository;
this.generalSettings = generalSettings;
}