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:

3 Likes

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

1 Like

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