public TableauAuthorizationService(IOptions <TableauSignInOptions> options,
                                    IOptions <TableauAdminCredentials> adminSignInOptions,
                                    TraffkTenantModelDbContext rdb,
                                    IHttpClientFactory httpClientFactory,
                                    ILogger logger)
 {
     TableauAdminCredentials = adminSignInOptions.Value;
     AdminTableauRestService = new TableauViewerService(options, TableauAdminCredentials, httpClientFactory, logger);
     Options = options.Value;
     Rdb     = rdb;
 }
예제 #2
0
        public TableauVisualServices(ITrustedTicketGetter trustedTicketGetter,
                                     IOptions <TableauSignInOptions> tableauSignInOptions,
                                     ILogger logger,
                                     IHttpClientFactory httpClientFactory)
        {
            Requires.NonNull(trustedTicketGetter, nameof(trustedTicketGetter));
            Requires.NonNull(tableauSignInOptions, nameof(tableauSignInOptions));

            HttpClientFactory    = httpClientFactory;
            TableauSignInOptions = tableauSignInOptions.Value;
            TrustedTicketGetter  = trustedTicketGetter;
            Logger = logger;
        }
예제 #3
0
        protected TableauBaseService(IOptions <TableauSignInOptions> options,
                                     ITableauUserCredentials tableauUserCredentials,
                                     IHttpClientFactory httpClientFactory,
                                     ILogger logger,
                                     ICacher cacher = null)
        {
            TableauUserCredentials = tableauUserCredentials;
            Logger            = logger;
            Cacher            = cacher ?? Cache.Passthrough;
            Options           = options.Value;
            Urls              = TableauServerUrls.FromContentUrl(Options.RestApiUrl, 10);
            HttpClientFactory = httpClientFactory;

            Login = SignIn(Urls, TableauUserCredentials.UserName, TableauUserCredentials.Password, logger);

            IsSignedIn = Login.IsSignedIn;
        }
예제 #4
0
        public TrustedTicketGetter(IOptions <TableauSignInOptions> tableauSignInOptions,
                                   ITableauUserCredentials tableauUserCredentials,
                                   ITableauTenantFinder tableauTenantFinder,
                                   IHttpClientFactory httpClientFactory)
        {
            Requires.NonNull(tableauSignInOptions, nameof(tableauSignInOptions));
            Requires.NonNull(tableauUserCredentials, nameof(tableauUserCredentials));

            HttpClientFactory      = httpClientFactory;
            TableauSignInOptions   = tableauSignInOptions.Value;
            TableauUserCredentials = tableauUserCredentials;
            var tenantId = tableauTenantFinder.GetTenantIdAsync().ExecuteSynchronously();

            if (tenantId != null)
            {
                TableauSignInOptions.UpdateForTenant(tenantId);
            }
        }
예제 #5
0
 public CurrentContextServices(
     ConfigStringFormatter stringer,
     ITraffkTenantFinder tenantFinder,
     TraffkTenantModelDbContext rdb,
     IHttpContextAccessor httpContextAccessor,
     UserManager <ApplicationUser> userManager,
     IOptions <TableauSignInOptions> tableauSigninOptions,
     ITableauAuthorizationService tableauAuthorizationService
     )
     : base(tenantFinder, rdb)
 {
     TableauSignInOptions = tableauSigninOptions.Value;
     Stringer             = stringer;
     TenantFinder         = tenantFinder;
     Rdb = rdb;
     HttpContextAccessor         = httpContextAccessor;
     UserManager                 = userManager;
     TableauAuthorizationService = tableauAuthorizationService;
 }