Happyr / LinkedIn-API-client

A library to connect with LinkedIn API. Perfect if you are looking for an API client or SDK for LinkedIn
MIT License
198 stars 97 forks source link

Happyr\LinkedIn\LinkedIn::getLoginUrl() returns empty string #128

Closed sterichards closed 8 years ago

sterichards commented 8 years ago
Q A
Bug? yes
New Feature? no
Are you using composer? yes
Version Specific version or SHA of a commit

Actual Behavior

What is the actual behavior? Empty string returned from Linkedin::getLoginUrl()

Expected Behavior

Return of a URL for the user to authenticate via

Steps to Reproduce

        $appId = $this->container->getParameter('happyr.linkedin.app_id');
        $appSecret = $this->container->getParameter('happyr.linkedin.app_secret');

        $linkedIn = new LinkedIn($appId, $appSecret);

        if ($linkedIn->isAuthenticated()) {
            //we know that the user is authenticated now. Start query the API
            $user=$linkedIn->get('v1/people/~:(firstName,lastName)');
            echo "Welcome ".$user['firstName'];

            exit();
        } elseif ($linkedIn->hasError()) {
            echo "User canceled the login.";
            exit();
        }

        //if not authenticated
        $url = $linkedIn->getLoginUrl();
        echo "<a href='$url'>Login with LinkedIn</a>";
        exit();
Nyholm commented 8 years ago

I suspect that you are getting some errors. Have you debugged the code?

sterichards commented 8 years ago

This was my own fault. I had been messing with the source of your library.

Sorry to bother

Nyholm commented 8 years ago

Okey. Im glad you solved it.

=)