1. Go to this page and download the library: Download webiny/oauth2 library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webiny / oauth2 example snippets
// load instance of `GPlus` configuration
$instance = OAuth2Loader::getInstance('GPlus');
// set access token
$instance->setAccessToken('...');
// do API requests to get user details
$userProfile = $instance->request()->getUserDetails();
// do an API request to a specific API method
$result = $instance->request()->rawRequest($url, $params);
class Instagram extends \Webiny\Component\OAuth2\AbstractServer
{
public function getAuthorizeUrl(){
// TODO: Implement _getUserDetailsTargetData() method.
}
public function getAccessTokenUrl(){
// TODO: Implement _getUserDetailsTargetData() method.
}
protected function _getUserDetailsTargetData() {
// TODO: Implement _getUserDetailsTargetData() method.
}
protected function _processUserDetails($result) {
// TODO: Implement _processUserDetails() method.
}
public function processAuthResponse($response) {
// TODO: Implement processAuthResponse() method.
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.