What is an algorithm or formula between X-Request-Id and X-Request-Sign headers?

Solved

What is an algorithm or formula between X-Request-Id and X-Request-Sign headers?

Maksym_Hniedko
Shopify Partner
2 0 0

Trying to figure out how my custom app with proxy endpoint could validate incoming request from shop web page. For example my request contains such headers after app proxy forwarder request to custom server:

 

"x-request-id":"3e1a07a6-5eae-4602-a2fe-6cc023c4ca67","x-request-id-sig":"pZCC94wJi96k2NVo84H3NiayWHs="

so could you please help me figure out how my app could recalculate signature for x-request-id header to check authenticity ?

 

"pZCC94wJi96k2NVo84H3NiayWHs=" === sign("3e1a07a6-5eae-4602-a2fe-6cc023c4ca67")

 

Thanks!

 

MH
Accepted Solution (1)

BorisD
Shopify Partner
4 2 2

This is an accepted solution.

Hello

 

You want use some header, but all data to calculate signature live in get in URL query parameters.
You should use this guide to calculate signature.

https://shopify.dev/apps/online-store/app-proxies#calculate-a-digital-signature

 

View solution in original post

Replies 3 (3)

BorisD
Shopify Partner
4 2 2

This is an accepted solution.

Hello

 

You want use some header, but all data to calculate signature live in get in URL query parameters.
You should use this guide to calculate signature.

https://shopify.dev/apps/online-store/app-proxies#calculate-a-digital-signature

 

Maksym_Hniedko
Shopify Partner
2 0 0

BorisD,

I did miss it 😅

thanks a lot!

 

MH

Xen-dev
Shopify Partner
16 0 1

Hi @Maksym_Hniedko 

How can we get the x-request-id header in the proxy app ?