public AntiForgery([NotNull] IClaimUidExtractor claimUidExtractor, [NotNull] IDataProtectionProvider dataProtectionProvider, [NotNull] IAntiForgeryAdditionalDataProvider additionalDataProvider, [NotNull] IOptionsAccessor<MvcOptions> mvcOptions) { var config = mvcOptions.Options.AntiForgeryOptions; var serializer = new AntiForgeryTokenSerializer(dataProtectionProvider.CreateProtector(_purpose)); var tokenStore = new AntiForgeryTokenStore(config, serializer); var tokenProvider = new TokenProvider(config, claimUidExtractor, additionalDataProvider); _worker = new AntiForgeryWorker(serializer, config, tokenStore, tokenProvider, tokenProvider); }
public AntiForgery([NotNull] IClaimUidExtractor claimUidExtractor, [NotNull] IDataProtectionProvider dataProtectionProvider, [NotNull] IAntiForgeryAdditionalDataProvider additionalDataProvider, [NotNull] IOptions <MvcOptions> mvcOptions) { var config = mvcOptions.Options.AntiForgeryOptions; var serializer = new AntiForgeryTokenSerializer(dataProtectionProvider.CreateProtector(_purpose)); var tokenStore = new AntiForgeryTokenStore(config, serializer); var tokenProvider = new TokenProvider(config, claimUidExtractor, additionalDataProvider); _worker = new AntiForgeryWorker(serializer, config, tokenStore, tokenProvider, tokenProvider); }
public AntiForgery([NotNull] IClaimUidExtractor claimUidExtractor, [NotNull] IDataProtectionProvider dataProtectionProvider, [NotNull] IAntiForgeryAdditionalDataProvider additionalDataProvider, [NotNull] IOptions<MvcOptions> mvcOptions, [NotNull] IHtmlEncoder htmlEncoder, [NotNull] IOptions<DataProtectionOptions> dataProtectionOptions) { var config = mvcOptions.Options.AntiForgeryOptions; var applicationId = dataProtectionOptions.Options.ApplicationDiscriminator ?? string.Empty; config.CookieName = config.CookieName ?? ComputeCookieName(applicationId); var serializer = new AntiForgeryTokenSerializer(dataProtectionProvider.CreateProtector(_purpose)); var tokenStore = new AntiForgeryTokenStore(config, serializer); var tokenProvider = new AntiForgeryTokenProvider(config, claimUidExtractor, additionalDataProvider); _worker = new AntiForgeryWorker(serializer, config, tokenStore, tokenProvider, tokenProvider, htmlEncoder); }
public AntiForgery([NotNull] IClaimUidExtractor claimUidExtractor, [NotNull] IDataProtectionProvider dataProtectionProvider, [NotNull] IAntiForgeryAdditionalDataProvider additionalDataProvider, [NotNull] IOptions <MvcOptions> mvcOptions, [NotNull] IHtmlEncoder htmlEncoder, [NotNull] IOptions <DataProtectionOptions> dataProtectionOptions) { var config = mvcOptions.Options.AntiForgeryOptions; var applicationId = dataProtectionOptions.Options.ApplicationDiscriminator ?? string.Empty; config.CookieName = config.CookieName ?? ComputeCookieName(applicationId); var serializer = new AntiForgeryTokenSerializer(dataProtectionProvider.CreateProtector(_purpose)); var tokenStore = new AntiForgeryTokenStore(config, serializer); var tokenProvider = new TokenProvider(config, claimUidExtractor, additionalDataProvider); _worker = new AntiForgeryWorker(serializer, config, tokenStore, tokenProvider, tokenProvider, htmlEncoder); }