none
Cannot connect to Azure AS using ADOMD through OAuth RRS feed

  • Question

  • 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?
    Thursday, April 4, 2019 4:25 AM

All replies