Skip to content
This repository was archived by the owner on Nov 13, 2021. It is now read-only.

DAPP授权 signature 问题 #4

@ewnk

Description

@ewnk

{"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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions