Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi guys,
I was following the steps in this topic:
Http://community.powerbi.com/t5/Developer/How-to-use-Power-BI-Rest-API-without-GUI-authentication-re...
To perform the same operations in PHP however I am having some difficulty playing in php,
- I created an an App at https://dev.powerbi.com/apps as NativeApp
- I gave all the permissions
- I got my client_id
Basically I'm making a request (post) on:
https://login.windows.net/common/oauth2/token
With the parameters:
grant_type = password
scope = openid
resource = https: //analysis.windows.net/powerbi/api
client_id = MY_CLIENT_IS
username = MY_USER_NAME
password = MY_PASSWORD
But I always get:
AADSTS65001: The user or administrator has not consented to use the application with ID 'CLIENT_ID'. Send an interactive authorization request for this user and resource. Trace ID: f9380076-1990-4d5d-b615-925a47121100
What's wrong?
Note: I don't use Azure Management Portal
Solved! Go to Solution.
Thanks @Eric_Zhang, I already solved it,
Just read a little more how the authentication flow works 🙂
Of course,
When I calmly read the message "The user or administrator has not consented to use the application" I started to ask myself "where could I consent the permissions", the quick response came "Azure AD".
I started to search how the Azure AD permissions system works and I found this link:
Https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applica...
After reading it I conclude: I created the application through PowerBI (http://dev.powerbi.com/apps) which generated an application in Azure AD (http://portal.azure.com), so I still had to delegate the application permissions - my user was also the account administrator so I just needed to grant the permissions.
Steps:
Create app on PowerBI > Go to Azure Portal > Find Azure Active Directory > Find the Application > Grant Permissions
Any questions are welcome.
Please look at below blog post see it helps.
https://zappysys.com/blog/howto-import-json-rest-api-power-bi/
Using ZappySys ODBC API drivers you can import any REST API.
Check below example how to use OAuth connection in ZappySys ODBC driver. You can select Custom Provider + OAuth 2.0 Version. Select Scope, Grant Type (i.e. Password Grant), Client ID, Userid, password.
You can also supply non-standard OAuth attributes on Advanced Tab (e.g. resource=http://your-resource-url)
@ZappySys I do not think it's the case of promoting a product on an important integration issue.
I was getting this same error in a native application using ADAL trying to access the PowerBI REST API. I had given all of the correct permissions in AAD as discussed in previous solutions, but had already received a token from a previous signin (before I gave the PowerBI Service permissions in AAD). My issue was that the previous token was stale and did not contain the updated claims. For me, the solution was to use PromptBehavior.RefreshSession as per the code below.
AuthenticationResult result = await authenticationContext.AcquireTokenAsync(resourceId, clientId, redirectURI, new PlatformParameters(PromptBehavior.RefreshSession, false));
As per MSDN, PromptBehavior.RefreshSession "Re-authorizes (through displaying webview) the resource usage, making sure that the resulting access token contains updated claims. If user logon cookies are available, the user will not be asked for credentials again and the logon dialog will dismiss automatically."
I want power bi authenication code in java.can please give some codes.
That is a more AAD related issue.
Check similar threads
http://stackoverflow.com/questions/34775287/oauth2-with-azure-ad-not-getting-user-consent
For better response, I'd suggest you post in AAD forum.
Thanks @Eric_Zhang, I already solved it,
Just read a little more how the authentication flow works 🙂
@visure wrote:
Thanks @Eric_Zhang, I already solved it,
Just read a little more how the authentication flow works 🙂
Could you share the solution?
Of course,
When I calmly read the message "The user or administrator has not consented to use the application" I started to ask myself "where could I consent the permissions", the quick response came "Azure AD".
I started to search how the Azure AD permissions system works and I found this link:
Https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applica...
After reading it I conclude: I created the application through PowerBI (http://dev.powerbi.com/apps) which generated an application in Azure AD (http://portal.azure.com), so I still had to delegate the application permissions - my user was also the account administrator so I just needed to grant the permissions.
Steps:
Create app on PowerBI > Go to Azure Portal > Find Azure Active Directory > Find the Application > Grant Permissions
Any questions are welcome.
Your clear and concise instructions really helped me out. I would have never figured out I had to go into portal.azure.com to enable the PowerBI permissions. I was thinking that Power BI was completely separate. Thanks a bunch for taking the time to post your solution!
Hello Visure,
Steps:
Create app on PowerBI > Go to Azure Portal > Find Azure Active Directory > Find the Application > Grant Permissions
Thanks a lot for your sharing and based on your steps, i couldn't find the Application before granting permissions? Could you kindly show the steps for "Create app on Power BI"?
Many thanks
Ludia
Hi @visure,
Doing same but still getting error:
AADSTS65001: The user or administrator has not consented to use the application with ID 'xxxxxxxxxxxxxxxxxx' named 'LSNTestAPP'. Send an interactive authorization request for this user and resource.\r\nTrace ID: 19f4be86-94db-45ad-961a-46a570ad4300\r\nCorrelation ID: 99c5058f-177a-459b-9509-def5865d5fcf\r\nTimestamp: 2017-12-22 06:43:15Z
It's error coming while login with power bi user credentials but when use azure port admin credentials then it's work so please let me know what i am missing to authenticate powerbi user to get access token.
I have spend lot of time on it please help me out to resove this isssue.
I hope for your quick response!
Thanks, that did the trick for me.
User | Count |
---|---|
13 | |
5 | |
2 | |
1 | |
1 |
User | Count |
---|---|
24 | |
3 | |
3 | |
2 | |
2 |