Delegation request to local network on web browser failed!

Fail info:
Code: 403 (Forbidden)
Body: Failed to authenticate request 0x9fbbf6b5b881e3613272090ee800f5118179ef0fd12b1f8b1195b6808a3f6a3c due to: Invalid delegation: Invalid canister signature: IcCanisterSignature signature could not be verified: public key 0a00000000000000070101422cec939c371c70ca587b6e640102da7866295b11cfedde8868649f23c23b85, signature …

Use identity auth the localhost, it seem that identity delegation do not work well.

Code like this:
const identity = await authClient.getIdentity();
const actor = Actor.createActor(idlFactory, {
agent: new HttpAgent({
identity,
}),
canisterId,
});

Did you find a solution?

If you are using local host canisters, you need to host your own version of II and connect with that. If you connect with https://identity.ic0.app/ then you need to be on the mainnet

2 Likes

You need to run II locally to use in development. Works fine when that is the case.

Environment requirement:

  • dfx version 0.7.0
  • Rust version 1.51
  • NodeJS (with npm) version TBD
  • CMake

Steps to do:
$git clone https://github.com/dfinity/internet-identity
$cd internet-identity
$npm install
$dfx start [--clean] [--background]
$II_ENV=development dfx deploy --no-wallet --argument '(null)'

User local provider in you js code, like this:
let identityProvider = "http://rwlgt-iiaaa-aaaaa-aaaaa-cai.localhost:8000/";
...
await authClient.login({
identityProvider,
onSuccess: ()=>{}
...
}

3 Likes

Do you know if it has to be on the same port? I have my app on port 8080 and II on 8000