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

.com Authentication Example #2

Open
KaitaniLabs opened this issue Feb 4, 2016 · 0 comments
Open

.com Authentication Example #2

KaitaniLabs opened this issue Feb 4, 2016 · 0 comments

Comments

@KaitaniLabs
Copy link

Great work on the WordpressAPI wrapper!

Do you have a .com authentication example for this wrapper? It looks very similar to other oauth wrappers, but I'm a little confused. So far I have this:

$wordpress = new ShortCirquit\WordPressApi\ComWpApi([
                    'clientId' => xxxxx,
                    'clientSecret' => xxxx,
                    'redirectUrl' => $url,
                ]);

                $request_token = $wordpress->getToken();

                $_SESSION['oauth_token'] = $request_token['oauth_token'];
                $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];

                if ($wordpress->http_code == 200) {

                    // Let's generate the URL and redirect
                    $url = $wordpress->getAuthorizeURL($request_token['oauth_token']);
                    header('Location: ' . $url);

                } else {

                    die();

                }

In the lib the ->getToken() method expects a parameter, but I don't understand where that should come from. Any help would be great thanks.

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

1 participant