Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply

How to create a custom connector that uses HMAC-SHA256 hashing

Here is the API I am trying to connect to in power bi:

 

https://apidocs.unleashedsoftware.com/AuthenticationHelp

 

There are 4 required headers

1) content-type (application/json)

2) Accept (application/json)

3) api-auth-id (app ID)

4) api-auth-signature (API key that is hashed with HMAC-SHA256)

 

Upon doing some research I have discovered that I need to create a custom connector using the power query sdk in visual studio.  Furthermore, I need to use the node.js function called crypto.hmac (https://nodejs.org/api/crypto.html#crypto_crypto_createhmac_algorithm_key_options) so that I can hash this signature.

 

With that being said, this is way out of my comfort zone.  Can anybody help me understand what the syntax would look like that would allow me to add this as a connector in power bi and pass in the above information.  The hardest part for me is understanding how to incorporate the crypto.hmac function in visual studio.

3 REPLIES 3
Anonymous
Not applicable

Hi,

 

Have you solved your issue? Facing something similar.

Ok I am actually very close, but having issues with the crypto.createhmac function:

 

section TripPin;

[DataSource.Kind="TripPin", Publish="TripPin.Publish"]
shared TripPin.Feed = Value.ReplaceType(TripPinImpl, type function (url as Uri.Type) as any);

TripPinImpl = (url as text) =>
let
source = Web.Contents(url, [ Headers = DefaultRequestHeaders ]),
json = Json.Document(source)
in
json;

DefaultRequestHeaders = [
#"Accept" = "application/json", // column name and values only
#"Content-Type" = "application/json", // we only support v4
#"api-auth-id" = "myAuthId",
#"api-auth-signature" = Crypto.CreateHmac(1,"myAuthKey", "1")
];

// Data Source Kind description
TripPin = [
Authentication = [
Anonymous = []
],
Label = "TripPin Part 1 - OData"
];

// Data Source UI publishing description
TripPin.Publish = [
Beta = true,
Category = "Other",
ButtonText = { "TripPin OData", "TripPin OData" }
];

Did you ever figure out how to do this?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.