March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I am attempting to create my first PowerBI Custom Connecter to connect to the Vimeo API. I am stuck on the final step of the authorization flow - getting back an access token. When trying out the Connecter in PowerBI, it seems to authenticate properly when I hit the access token endpoint, but I get back a warning "[unsupported_grant_type] Unsupported grant type"
It appears I am not sending the grant_type properly in the request. Here are Vimeo's requirements of what is sent along in the body of the request:
Here is a snippet of code from the Customer Connector I am building. It is within this TokenMethod function that I am trying to fufill the requirements of the image above:
TokenMethod = (grantType, tokenField, code) =>
let
queryString = [
grant_type = "authorization_code",
redirect_uri = redirect_uri,
client_id = client_id,
client_secret = client_secret
],
queryWithCode = Record.AddField(queryString, tokenField, code),
authKey = "Basic " & Binary.ToText(Text.ToBinary("client_id:client_secret"),BinaryEncoding.Base64),
tokenResponse = Web.Contents(token_uri, [
Content = Text.ToBinary(Uri.BuildQueryString(queryWithCode)),
Headers = [
#"Authorization" = authKey,
#"Content-type" = "application/json",
#"Accept" = "application/vnd.vimeo.*+json;version=3.4"
],
ManualStatusHandling = {400}
]),
body = Json.Document(tokenResponse),
result = if (Record.HasFields(body, {"error", "error_description"})) then
error Error.Record(body[error], body[error_description], body)
else
body
in
result;
I'm wondering if someone could please point out where I might be going astray in the code and why I am recieving the [unsupported_grant_type] error.
Many thanks for your time,
-Josh
Hi @rrredirect
Sorry for that I'm not familiar with customer connector. But based on my researching,
1.The grant_type parameter must be set to “authorization_code”.
2.The grant_type ,
code, Client Authentication paremeters are required.
So such error may be caused by the unknown "grantType"
TokenMethod = (grantType, tokenField, code) =>
Or no code parameter in
Refer to:
Authorization code flow - Azure Active Directory B2C | Microsoft Docs
Solved: OAuth 2.0 Authorization Code flow grant type - Pow... - Microsoft Power BI Community
Authorization Code Grant - OAuth 2.0 Simplified
In addition, you may post your issue on Developer - Microsoft Power BI Community for further helps.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
82 | |
69 | |
53 | |
44 |
User | Count |
---|---|
206 | |
106 | |
102 | |
66 | |
57 |