Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DevTokens #24

Open
ben-kn-app opened this issue Jul 4, 2016 · 2 comments
Open

Add support for DevTokens #24

ben-kn-app opened this issue Jul 4, 2016 · 2 comments

Comments

@ben-kn-app
Copy link
Contributor

ben-kn-app commented Jul 4, 2016

The content of this issue isn't meant to be complete, just as a quick reference for some who are looking to get this to work with a Developer Token.

In the Feedly class (Feedly.php), I have added a custom function storeDevToken (see below), it injects the developer token you can get from https://feedly.com/v3/auth/dev

public function storeDevToken($devToken) {
            $response = new AccessTokenResponse(
                array(
                    'access_token' => $devToken,
                    'expires_in' => (time()+(30 * 24 * 60 * 60)))
            );

            $this->accessTokenStorage->store($response);

            return $response;
}

Then I can access the content from my account, bypassing the oauth altogether: (see above link how to get this token)

$clientSecret = "YourAccessToken";
$feedly = new feedly\Feedly(new feedly\Mode\DeveloperMode(), new feedly\AccessTokenStorage\AccessTokenSessionStorage());
$feedly->storeDevToken($clientSecret);
$model = $feedly->profile();
$response = $model->fetch();
print_r($response);

Hope it saves someone else some time.

@x011
Copy link

x011 commented Oct 17, 2017

It will definitively save me some time, tks for sharing!

@cristianr909090
Copy link

Good function!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants