Sending front-end Principal to caller

Hi!
I have a front-end canister calling a shared backend, sometimes I want to send the frontend canister principal to the BE but I got the anonymous user Id instead, here is example:

// FE
constructor(identity) {
const canisterId = process.env.CANISTER_ID_SF_ORDER;
if (identity) {
this.actor = createActor(canisterId, { agentOptions: { identity } });
} else {
this.actor = createActor(canisterId);
}
}

const resp = await this.actor.doJobb();

// BE
public shared ({ caller }) func doJobb( …
Error:
Unauthorized caller: 2vxsx-fae. …
Here I am getting the anonymous user, I want the Front-end principal

One more question
public shared ({caller}) func getJobs(sectionId: Text) : async Result<[Jobs], Text> {
await Lib.hasAccess(caller, sectionId, 5);

// Does the function above use cycles? how to do it as a query like below ( the exemple below won’t compile “missplaced await”)
public query({caller}) func getJobs(sectionId: Text) : async Result<[Jobs], Text> {
await Lib.hasAccess(caller, sectionId, 5);

old topic Inter-Canister Query Calls (Status: done) - #105 by ulan

you might still use the default actor (this.actor = createActor(canisterId);), check if the identity set correctly after authentication