This repository was archived by the owner on Nov 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
DAPP授权 signature 问题 #4
Copy link
Copy link
Open
Description
{"error":"Invalid app authentication signature.","success":false}
code
const privateKey = "6e204c62726a19fe3f43c4ca9739b7ffa37e4a3226f824f3e24e00a5890addc6";
const appAddress = 'f89f342992c3f3c12c0b3a5c11226dc2154fbb26';
const address= '86248535534919506cc130b21a32383cf36c5b1a';
const { signature } = utility.signBlockData({
app_provider: 'press.one',
app_address: appAddress,
auth_address: address,
authorized: true,
},
privateKey
);
const payload = {
appAddress,
authAddress: address,
authorized: true,
signature
};
global.api
.post('/api/apps/authenticate')
.send({ payload })
.set(
utility.getAuthHeader(
'/apps/authenticate',
payload,
privateKey
)
)
.end((_err, res) => {
console.log(JSON.stringify(res.body));
// res.status.should.equal(200);
// done();
});
Metadata
Metadata
Assignees
Labels
No labels