无法通过OAuth使用ADOMD连接到Azure AS [英] Cannot connect to Azure AS using ADOMD through OAuth

查看:66
本文介绍了无法通过OAuth使用ADOMD连接到Azure AS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过传入通过OAuth获取的访问令牌来使用ADOMD连接到Azure Analysis Services,但无论我设置了哪些权限以及我尝试的凭据/令牌组合,它都不会进行身份验证。我想确保我是正确理解Azure AS身份验证的




以下是我的身份验证过程:



  1。向Gtt请求https://login.microsoftonline.com/[tenant]/oauth2/authorize以获取前端的授权令牌。将发送应用程序ID。系统会提示用户登录。用户在另一个文本字段中输入数据源主机。

  2。客户端使用授权令牌和主机向后端发出POST请求。

  3。服务器向https://login.microsoftonline.com/ [tenant]/oauth2/token发出POST请求以获取访问令牌。它发送应用程序ID,应用程序密钥,授权类型,代码和重定向URI。从API获取访问令牌和刷新令牌。

  4。然后,服务器使用以下连接字符串尝试ADOMD.NET连接:Provider = MSOLAP; Data Source = {host}; Initial Catalog =; User ID =; Password = {access_token}; Persist Security Info = True; Impersonation Level = Impersonate。

  5。 ADOMD.NET抛出一个错误,只是说"身份验证失败"。



我已经添加了应用服务主体和我正在尝试登录的用户与使用SSMS的管理员角色。
$


如果我对连接字符串进行硬编码,将用户名设置为app:{app-id}并输入密码,则连接完美作为客户的秘密。但是,我想要用户身份验证。



我是不是正确理解了如何使用ADOMD对用户进行身份验证?或者在这个过程中我做错了什么?

I'm trying to connect to Azure Analysis Services using ADOMD by passing in an access token obtained through OAuth, but no matter which permissions I set and what combination of credentials/tokens I try, it will not authenticate. I want to make sure I'm understanding Azure AS authentication correctly.

The following is my authentication process:

 1. Make GET request to https://login.microsoftonline.com/[tenant]/oauth2/authorize to obtain an authorization token on the frontend. An app ID is sent. The user is prompted to log in. The user inputs the data source host in another text field.
 2. Client makes POST request to backend with the authorization token and host.
 3. Server makes POST request to https://login.microsoftonline.com/[tenant]/oauth2/token to obtain access token. It sends the app ID, app secret, grant type, code, and redirect URI. An access token and refresh token are obtained from the API.
 4. Server then attempts an ADOMD.NET connection using the following connection string: Provider=MSOLAP;Data Source={host};Initial Catalog=;User ID=;Password={access_token};Persist Security Info=True;Impersonation Level=Impersonate.
 5. ADOMD.NET throws an error that just says "authentication failed".

I've already added the app service principal and the user I'm attempting to log in with to the Administrator role using SSMS.

It connects perfectly if I hard-code the connection string, setting the username as app:{app-id} and the password as the client secret. However, I want user authentication.

Am I just not understanding the concepts correctly on how to authenticate a user using ADOMD? Or is there something I'm doing wrong in this process?

推荐答案

您好,

您可以参考下面的文章有助于使用ADOMD连接到Azure Analysis服务。

You may refer the below articles helps to connecting to Azure Analysis services using ADOMD.

https://www.sanjaybhagia.com/2018/11/12/accessing-azure-analysis-services-models-using-net-core/

https:// unnieayilliath。 com / 2017/11/12 / connections-azure-analysis-services-using-adomd /

希望这会有所帮助。


这篇关于无法通过OAuth使用ADOMD连接到Azure AS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆