Federicoviola
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Forum: Plugins
In reply to: [Keyring] Can not store a new token in the keyringThanks Beau for your answer.
But I don’t think that the problem were that. I’ve tested this service with only this piece of code:class Keyring_Service_Mendeley extends Keyring_Service_OAuth1 { const NAME = 'mendeley'; const LABEL = 'Mendeley'; var $authorization_header; var $authorization_realm; function __construct() { parent::__construct(); // Enable "basic" UI for entering key/secret add_action( 'keyring_mendeley_manage_ui', array( $this, 'basic_ui' ) ); //$this->authorization_header = true; $this->authorization_realm = "https://www.mendeley.com/oapi/"; $this->set_endpoint( 'request_token', 'https://www.mendeley.com/oauth/request_token/', 'GET' ); $this->set_endpoint( 'authorize', 'https://www.mendeley.com/oauth/authorize/', 'GET'); $this->set_endpoint( 'access_token', 'https://www.mendeley.com/oauth/access_token/', 'GET'); if ( defined( 'KEYRING__MENDELEY_KEY' ) && defined( 'KEYRING__MENDELEY_SECRET' ) ) { $this->key = KEYRING__MENDELEY_KEY; $this->secret = KEYRING__MENDELEY_SECRET; } else if ( $creds = $this->get_credentials() ) { $this->key = $creds['key']; $this->secret = $creds['secret']; } $this->consumer = new OAuthConsumer( $this->key, $this->secret, $this->callback_url ); $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1; $this->requires_token( true ); }
And it works but returns me in WP a blank page. In the browser I get the following line:
https://192.168.1.40/wordpress/wp-admin/tools.php?page=keyring&service=mendeley&action=verify&kr_nonce=597fcb6eff&nonce=e78d6c2116&oauth_token=a9b3e0b01c0ce48abcb5e19788e03b65050bf2092&oauth_verifier=949c5605a1
The twitter service works and return in the browser the following line:
https://192.168.1.40/wordpress/wp-admin/tools.php?page=keyring&service=twitter&action=created&id=59&kr_nonce=ed950fe3d3
The
&action
is different. I don’t realize why…
BTW I based my code in the twitter template.
Viewing 1 replies (of 1 total)