creación oath_signature en oath 1.0

creación oath_signature en oath 1.0

Postby jlborlando » Sat Oct 21, 2023 10:37 pm

Hello everyone,
I have a problem creating a signature to validate my identity in an oath 1.0 system
y have this credentials

oauth_consumer_key="8pr53tcagfih9bpvo24m1t8z9xd42tx3",
oauth_nonce="W6ndLpigOjP025vmvGSJdqEEylRUusgg",
oauth_signature_method="HMAC-SHA256",
oauth_timestamp="1697034473",
oauth_token="jx9997t7pd3ldvjemmiz9co6qtxj3igk",
oauth_version="1.0"' \

and....
Consumer Secret and Access Token Secret

I create the oath_signature parmeter with openssl
1- I create a file param.txt with the method, uri and parameters

POST&http://testting.ip.xxxxxxxcontent.com/staging.cal/rest/V1/products&oauth_consumer_key=8pr53tcagfih9bpvo24m1t8z9xd42tx3&oauth_nonce=W6ndLpigOjP025vmvGSJdqEEylRUusgg&oauth_signature_method=HMAC-SHA256&oauth_timestamp=1697034473&oauth_token=jx9997t7pd3ldvjemmiz9co6qtxj3igk&oauth_version=1.0

2- I run openssl.exe
openssl dgst -hmac "CONSUMER_SECRET&$ACCESS_TOKEN_SECRET" -binary -sha256 < param.txt

3 - i convert de binary result to base64, and the result is not valid !

Is there a way to generate the valid signature in some way?

best regards , jorge
jlborlando
 
Posts: 3
Joined: Sat Oct 21, 2023 7:08 pm

Re: creación oath_signature en oath 1.0

Postby audisys » Mon Oct 23, 2023 1:06 am

Hello,

Check out this link and it may help you with your problem.

[url]
https://forum.modharbour.app/viewtopic. ... OKEN#p1394
[/url]

It is an excellent contribution to the
JSON Web Token (JWT) support

Saludos,
José David Angulo
Auditoria y Sitemas Ltda.
Cartagena Colombia
audisys
 
Posts: 49
Joined: Wed Apr 18, 2007 6:01 pm
Location: Cartagena - Colombia

Re: creación oath_signature en oath 1.0

Postby jlborlando » Tue Oct 24, 2023 1:45 pm

David,
The problem I had is how I put together the string to be encrypted,
when to consider or not the characters that should be converted to hexadecimal,
that was solved, both your contribution and openssl work perfectly

thanks again
best regards
jlborlando
 
Posts: 3
Joined: Sat Oct 21, 2023 7:08 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 70 guests