I cannot use Internet Identity

I have in my app:

    useEffect(() => {
        async function doIt() {
            const authClient = await AuthClient.create();

                // 7 days in nanoseconds
                maxTimeToLive: BigInt(7 * 24 * 60 * 60 * 1000 * 1000 * 1000),
                onSuccess: async () => {
                onError(error) {
                    console.log('error', error);
    }, []);

But it does not ask user to connect Internet Identity. Instead it outputs in the browser logs:

WARNING: expected origin 'https://identity.ic0.app', got '' (ignoring)

What is my error?

Also, how to get the ID (I think, it is Principal; or maybe, it’s the small integer that identifies the user on NNS (but I think, the small number may be duplicate on different identity providers, so it probably doesn’t suit me)) of the currently logged in user?

I’ve added

identityProvider: "",

to authClient.login.

Now the message WARNING: expected origin... disappeared, but (weirdly) my software now does not output anything in browser logs and does not show any UI to the user.

Popus were blocked in the browser. Now after I unblocked it, it all works.


May I ask how you got rid of the “WARNING: expected origin…” issue?

I’m having the same issue so I can’t make authentication work…

As far as I understand, the warning triggers if the identityProvider URL isn’t the same URL as the event from which it is triggered? :thinking:
That can’t be right, because the Internet Identity URL isn’t the same as my app.

Any help would be appreciated :pray:

P.S: I’ve tried with both and http://canisterId.localhost:4943/ syntax and Chrome, Firefox and Safari.