Module: WordpressApi::Helpers::Authorization

Included in:
Client
Defined in:
lib/wordpress_api/helpers/authorization.rb

Constant Summary collapse

DEFAULT_OAUTH_OPTIONS =
{
  :authorize_path     => "/oauth2/authorize",
  :api_host           => "https://public-api.wordpress.com",
  :auth_host          => "https://public-api.wordpress.com",
}

Instance Method Summary collapse

Instance Method Details

#access_tokenObject



16
17
18
# File 'lib/wordpress_api/helpers/authorization.rb', line 16

def access_token
  @access_token ||= ::OAuth2::AccessToken.new(consumer, @auth_token)
end

#authorize_from_access(atoken) ⇒ Object



20
21
22
# File 'lib/wordpress_api/helpers/authorization.rb', line 20

def authorize_from_access(atoken)
  @auth_token = atoken
end

#consumerObject



12
13
14
# File 'lib/wordpress_api/helpers/authorization.rb', line 12

def consumer
  @consumer ||= ::OAuth2::Client.new(@consumer_token, @consumer_secret, parse_oauth_options)
end