Sign in with Apple using from Firebase Web SDK: getting null displayName

53 views Asked by At

I've set up "Sign in with Apple" using Firebase Web SDK as described on this guide: https://firebase.google.com/docs/auth/web/apple

I'm getting everything returned correctly from the SDK except for user.displayName returning null.

This is an excerpt of the code I'm using:

var provider = new firebase.auth.OAuthProvider('apple.com');

provider.addScope('email');
provider.addScope('name');

firebase.auth()
    .signInWithPopup(provider)
    .then((result) => {
    
        console.log(result.user); // displays user.displayName = null

    });

I know that Apple only returns name information on first authentication with the same app, unless you go to your Apple security settings / "sign in with apple" and cancel the association with that app.

Important clue: I can see from the network logs that google is correctly returning firstName, lastName and displayName to my web app, so the problem is on the Firebase web SDK not returning it to me.

I've googled everything, but no I've found no solution except for using a different library.

Anyone faced and solved this issue?

Notes:

0

There are 0 answers