Wants to login to the backend canister deployed link using login button with principal id i get when i login in a frontend app

i get a principal id in the localhost frontend app in which i ahve implemented auth login using ic-auth-client different from when i login in this https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=7amc6-qqaaa-aaaam-acntq-cai

the login method in my frontend is:
pub async fn login(&mut self) → Result<(), String> {
let mut dfx_network = dotenv!(“BACKEND”).to_string();
if dfx_network.is_empty() {
dfx_network = env::var(“BACKEND”).expect(“BACKEND is must be set”);
}

    let identity_provider: Option<Url> = match dfx_network.as_str() {
        "LOCAL" => Some({
            let port = 4943;
            let canister_id = BACKEND_ID;
            Url::new(&format!("http://{}.localhost:{}", canister_id, port)).unwrap()
        }),
        "LIVE" => Some(Url::new("https://identity.ic0.app/#authorize").unwrap()),
        _ => panic!("Unknown dfx network: {}", dfx_network),
    };

    let mut builder = AuthClientLoginOptions::builder()
        .max_time_to_live(7 * 24 * 60 * 60 * 1_000_000_000) // 7 days in nanoseconds
        .on_success(|_| {
            // Handle successful login
            info!("Login successful");
        })
        .on_error(|_error| {
            // Handle login error
            // info!(&format!("Login failed: {:?}", error));
        });

    // Only set the identity_provider if it's Some
    if let Some(provider) = identity_provider {
        builder = builder.identity_provider(provider);
    }

    let options = builder.build();

    // Use await here to wait for the login process to complete
    self.auth_client.login_with_options(options);

    // Verify authentication after login
    if self.auth_client.is_authenticated() {
        // window().unwrap().location().reload().unwrap();

        Ok(())
    } else {
        Err("Authentication failed".to_string())
    }
}

The principals you receive from Internet Identity are dependent on the URL you login to. This is done to limit cross-site tracking. If you login locally, you log in from localhost:4943. When you login from a4gq6-oaaaa-aaaab-qaa4q-cai.raw.icp0.io, you get a different principal.

Short version: II does not allow you to do that

what if i deploy the local app and tthen?
note the local app i am referring to is frontend code only or app