Unable to fetch access_token from Extension.CurrentCredential() #299
Replies: 4 comments 5 replies
-
The reason I need to do this is because the APIs require the Authorization header to have the value : Zoho-oauthtoken <access_token> |
Beta Was this translation helpful? Give feedback.
-
What is your entry point into this connector? I wonder if when you're calling the entry function that the authentication logic hasn't been run yet?
|
Beta Was this translation helpful? Give feedback.
-
Make sure the
|
Beta Was this translation helpful? Give feedback.
-
@mattmasson , @geologyrocks - If I do a Visual Studio debug, Fiddler shows the call to the token endpoint and hence, it works fine. |
Beta Was this translation helpful? Give feedback.
-
Hi experts
I am building a PowerQuery Custom Connector (for Zoho APIs) in Visual Studio to be deployed to Power BI.
While debugging/launching from Visual Studio, I can see the data being fetched from the API; however, if I deploy the connector to the Power BI Custom Connectors folder, the same code doesn't work.
I get an error in Power BI while trying to use the Connector :
Details: "The field 'access_token' of the record wasn't found."
The snippet where I am accessing the token after the OAuth flow -
`...
token = GetToken(),
apiResponse = zoho.CallApi(apiEndpoint, token),
...
GetToken = () =>
let
access_token = Extension.CurrentCredential()[access_token]
in
access_token;
zoho.CallApi = (apiEndpoint as text, accessToken as text) =>
let
// Make API request using the access token
apiResponse = Json.Document(
Web.Contents(
apiEndpoint,
[Headers = [#"Authorization" = "Zoho-oauthtoken " & accessToken]]
)
)
in
apiResponse;
...
zoho = [
Authentication = [
OAuth = [
StartLogin=StartLogin,
FinishLogin=FinishLogin,
Refresh=Refresh,
Logout=Logout
]
]
];
//Implementations for StartLogin, FinishLogin, Refresh and Logout
`
Is there any restriction in invoking Extension.CurrentCredential() from Power BI (December 2023 version)?
Beta Was this translation helpful? Give feedback.
All reactions