简体   繁体   中英

How to Connect to Tabular Cube Server Using Credentials Provided in a ConnectionString?

Microsoft says:

https://docs.microsoft.com/en-us/analysis-services/instances/connection-string-properties-analysis-services?view=asallproducts-allversions

"When connecting over TCP to SSAS, the client library will impersonate the Windows user using the specified username and password, and then connect as usual to the server."

"When connecting over HTTP(S) to SSAS, the credentials are provided to the web server based on the authentication mode configured on the web server, for example Basic auth or Windows auth. The web server will perform the appropriate Windows impersonation before connecting to the SSAS server, therefore providing the correct credentials flow to the server."

However, when I do this:

 using Tabular = Microsoft.AnalysisServices.Tabular;

 using (Tabular.Server server = new Tabular.Server())
 {   
    //connectionString = "Provider=MSOLAP;DataSource=ServerIP;UserID=xx;Password=xx;Persist Security Info=True;Impersonation Level=Impersonate;"

    server.Connect(connectionString);
 }

It uses the credentials of my user account that's running the code, not the the UserID and Password in the ConnectionString.

How can I get it to connect via "TCP"?

If your app or web app isn't already running under those credentials then you will need to impersonate that identity in your code before you connect. Here is an example .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM