Has someone managed to implement a LinkedIn login with Firebase on iOS?

11,823

Solution 1

Firebase Authentication supports only four federated Identity Providers out of the box: Google, Facebook, Twitter and GitHub.

For every other provider you have to use custom tokens (you will need an external Webservice).

You can read more here for a full example (the link is for Instagram but it will also work for LinkedIn as they say).

Solution 2

See this example in official Firebase repo: Use LinkedIn Sign In with Firebase

In this sample we use OAuth 2.0 based authentication to get LinkedIn user information then create a Firebase Custom Token (using the LinkedIn user ID).

Solution 3

Looks like the post is few years old, so not sure if you have found the solution, but for the benefit of everyone. in the current version of firebase, this is how I was able to use LinkedIn.

export function signUpWithLinkedIn() {
    return auth
        .setPersistence(firebase.auth.Auth.Persistence.SESSION)
        .then(()=>{
            const provider = new firebase.auth.OAuthProvider('linkedin.com');
            provider.addScope('r_emailaddress');
            provider.addScope('r_liteprofile');
            auth
                .signInWithPopup(provider)
                .then(result=>{
                    console.group('LinkedIn');
                    console.log(result);
                    console.groupEnd();
                    return result;
                })
                .catch(error=>{
                    console.group('LinkedIn - Error');
                    console.log(error)
                    console.groupEnd();
                    throw error;
                });

        });
}
Share:
11,823
Edouard Barbier
Author by

Edouard Barbier

Self-thought iOS Developer & ex-Google Play BD @Google London @barbieredouard on Twitter and @edouard_iosdev on Instagram

Updated on June 15, 2022

Comments

  • Edouard Barbier
    Edouard Barbier almost 2 years

    I'm currently building an app and I would like people to be able to sign up with their LinkedIn account.

    I'm using Firebase for the back-end and LinkedIn isn't currently supported by the FirebaseAuth framework.

    I know Firebase allows Custom Auth System but even after reading the doc about this, I still struggle to understand how I can plug LinkedIn there and what the so-called authentification server is.

    Has someone managed to make this work?

    Thanks in advance for your inputs.

  • aldel
    aldel almost 5 years
    There are several others with built-in support now (including Microsoft and Yahoo), but still no LinkedIn.