Module: Wordpress::API::Oauth
- Defined in:
- lib/wordpress/api/oauth.rb
Instance Method Summary collapse
Instance Method Details
#get_token(params = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/wordpress/api/oauth.rb', line 5 def get_token(params = {}) validate_keys! params, [:client_id, :client_secret, :code, :grant_type, :redirect_uri] + default_keys exec_api(Wordpress::Request.new(:post, "oauth2/token",nil, params )) do |json| Wordpress::Object::Oauth.new(self, json) end end |
#token_info(params = {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/wordpress/api/oauth.rb', line 13 def token_info(params = {}) validate_keys! params, [:client_id, :token] + default_keys exec_api(Wordpress::Request.new(:get, "oauth2/token-info",params, )) do |json| Wordpress::Object::Oauth.new(self, json) end end |