Identity between canister owner and function caller are not equal

Hi,

I have the following snippet

shared(msg) actor class Organisations() {

    let canisterOwner = msg.caller;

     public shared(caller) func debugIdentity() : async Text {
        let result = "Caller : " # Principal.toText(caller.caller) # " canister Owner: " # Principal.toText(canisterOwner) # " Caller hash : " # Nat32.toText(Principal.hash(caller.caller)) # " Canister Owner hash : " # Nat32.toText(Principal.hash(canisterOwner)) ;
        return result;
    };
};

I deploy using default identity dfx --identity default deploy

And call it as dfx --identity default canister call organisations debugIdentity

I expect to get the same identity between canister owner and function caller. But there are different.

(
“Caller : gwa27-fxplx-wxche-go5up-irof3-bpuxh-4wzon-tdkb7-disam-ehhrw-tqe canister Owner: rwlgt-iiaaa-aaaaa-aaaaa-cai Caller hash : 897691542 Canister Owner hash : 2375444897”,
)

if I am using command: dfx identity get-principal
I got the caller id gwa27-fxplx-wxche-go5up-irof3-bpuxh-4wzon-tdkb7-disam-ehhrw-tqe

I am using dfx 0.7.1

I could not find my mistake.

Thanks for advice’s

1 Like

Hey, I’m not sure if dfx --identity default deploy stops the proxying through the wallet canister. I’m not on a machine right now but maybe you can check the dfx deploy --help command to see if there’s a flag for it?

This is for reference:

2 Likes

Use some permutation of --no-wallet. Dfx routes requests through a wallet canister unless you use this and things get wonky.

Hi,

Yes, thanks with following command dfx canister --wallet=$(dfx identity get-wallet) call organisations debugIdentity I got the same id.

:+1:

1 Like

Hi,
I tried your proposition using command dfx canister --no-wallet call organisations debugIdentity but I still have different id’s.

Thanks