Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature couldn't not be verified when calling a local canister #7

Closed
anthonymq opened this issue Nov 5, 2021 · 7 comments
Closed

Comments

@anthonymq
Copy link

Hi,
I'm having trouble adding stoic identity to my project.
After login and creating my actor with a "StoicIdentity", I get this error everytime I try to call a canister :
Invalid delegation: Invalid canister signature: IcCanisterSignature signature could not be verified: public key 0a000000000000000701017a64cedc008f2dcb5f08fffc8dfaed81b7b741875d548aae8fd7d4caa7d901ab, signature d9d9f7a26b63657274696669636174655901fdd9d9f7a2647472656583018301830183024863616e69737465728301830182045820d79afedb65fdf5f9aa2242a0818a3d0f06c8d151786eccabd9dac3a9b8232cc883018204582089ca68f6f2c292bb8d609a83c9293425aabd237f919444abd01f420c9d8c7904830182045820374023cb1c329e564e25497df6e446874b63f1c15428ea7b6e7b70aa7f6cdcfa83024a000000000000000701018301830183024e6365727469666965645f64617461820358206a0ff14ac81f146044279c801174b94ada9f3be9fcb7b19f462e2620f70f726582045820fd5b59459758c8afecaf7285da359e4b5adb945fb86a3c1f0efd996c21a9693882045820d127e07870900eb1aa5ab3ac074952776b020b160c86f0ddd8986bf78e8e132e8204582009e862f3f29e5b93b70b0814329bc3d148b425263dbfd87164eb6b57bf1206c18204582094a6f4c3d1f1538dc3fd445b491e19ac025606bb7dfeaea3a74e2714bf73ed928204582060735ff0cdc6bb5382c067507d980ebab56e7ff0b41fbd9edfae43fbec33bf3d83018204582022e9c3c16d2a6f1924359ca1152c9094f5909a944ea577675d378c82923cd80e83024474696d658203498aa8a7f5b3aba7da16697369676e617475726558308b63224f28c05c5f590fb72f8f9d457dc857b3226a9c4a21bdc4dec8b0c2bd68d6f96c9ea857f8ddbcd4ca311374622b6474726565830182045820f036402586744c2b5cf1960867c23b31bb6dd153562e1325f0c8f2d1d6d605998302437369678301820458200ee5c706863f98605c58dfc673770484b8614cb6a471daae1012ee75586f5f8f830182045820af00e4ef451ece1c99b45a51f9d31de4172ae77cf99cf8300809a2c115f2f78a830182045820c3d5673202c6af42ec4ee32c08d9fde14f99b6dbd0eb25b66a7ef29bd0741fb6830182045820fcc14312e5d2b8f476bdd126271aa88454f85c7a39b52d5e6e3aaecbba6643ad83025820a6e94ecc290d5d70ae885d2c96e2b86bd89bb516fa3d228df1af5e114508b9968302582032b6d013eca6add0d9bfca3ffbea857870d68fe780552917bd763263a1b64b81820340, error: certificate verification failed: failed to verify threshold signature: root_hash=CryptoHash(0x828f1036d2ffd400ce4d08fb585070d7122d5a73d0f8131cd81c687103f9166f), sig=Blob{48 bytes;8b63224f28c05c5f590fb72f8f9d457dc857b3226a9c4a21bdc4dec8b0c2bd68d6f96c9ea857f8ddbcd4ca311374622b}, pk=ThresholdSigPublicKey { internal: ThresBls12_381(0x9865cbf948ce4a1717bdb0ccf7bdfbb3ba60184cf9ffa851730798934a5e42583b3b03205adafb274f00764d6f3dfef71286277485fd7edc1d5204bddfc152824d6cb571778f657503004754f17f4f257d1d24d928c273141704c7438f9400a7) }, error=ThresBls12_381 signature could not be verified: public key 9865cbf948ce4a1717bdb0ccf7bdfbb3ba60184cf9ffa851730798934a5e42583b3b03205adafb274f00764d6f3dfef71286277485fd7edc1d5204bddfc152824d6cb571778f657503004754f17f4f257d1d24d928c273141704c7438f9400a7, signature 8b63224f28c05c5f590fb72f8f9d457dc857b3226a9c4a21bdc4dec8b0c2bd68d6f96c9ea857f8ddbcd4ca311374622b, error: Invalid combined threshold signature

My dependencies :

    "@dfinity/agent": "0.10.1",
    "@dfinity/auth-client": "0.10.1",
    "@dfinity/authentication": "0.10.1",
    "@dfinity/candid": "0.10.1",
    "@dfinity/identity": "0.10.1",
    "@dfinity/principal": "0.10.1",
    "ic-stoic-identity": "^2.0.0",

Can you help me with this issue ?

@ayjayem
Copy link

ayjayem commented Nov 30, 2021

Hi there,

Facing the same issue, I think - "Error: Fail to verify certificate" after implementing Stoic Identity in a project deployed locally, logging in, and calling a (local) canister function requiring use of the Stoic Identity.

@ayjayem
Copy link

ayjayem commented Nov 30, 2021

I think my error may be different, but it seems to have been solved with "agent.fetchRootKey()" before constructing the Actor using that agent.

@anthonymq
Copy link
Author

Are you running your frontend on a live server or from your local ic replica ? Still can't figure out what am doing wrong

@ayjayem
Copy link

ayjayem commented Nov 30, 2021

Frontend is running on my local IC replica, in my case.

@anthonymq
Copy link
Author

Last question, are you running stoicwallet locally ?

@anthonymq
Copy link
Author

Okay I found my error, I was authenticating through stoic-identity with Internet Identity which can't work locally

@ayjayem
Copy link

ayjayem commented Dec 2, 2021

Can I ask, @anthonymq - were you able to get Stoic Identity working locally, with your frontend and canisters all running locally?

I'm now running into the issue that "msg.caller" in a canister receiving a call from the (locally-deployed) frontend is always just my default wallet principal - not the Stoic Identity principal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants