Module: PayPal::SDK::Core::OpenIDConnect

Includes:
DataTypes
Defined in:
lib/paypal-sdk/core/openid_connect.rb,
lib/paypal-sdk/core/openid_connect/api.rb,
lib/paypal-sdk/core/openid_connect/get_api.rb,
lib/paypal-sdk/core/openid_connect/set_api.rb,
lib/paypal-sdk/core/openid_connect/data_types.rb,
lib/paypal-sdk/core/openid_connect/request_data_type.rb

Defined Under Namespace

Modules: DataTypes, GetAPI, RequestDataType, SetAPI Classes: API

Constant Summary collapse

AUTHORIZATION_URL =
"paypal.com/signin/authorize"
ENDSESSION_URL =
"paypal.com/webapps/auth/protocol/openidconnect/v1/endsession"
DEFAULT_SCOPE =
"openid"

Class Method Summary collapse

Class Method Details

.apiObject



14
15
16
# File 'lib/paypal-sdk/core/openid_connect.rb', line 14

def api
  RequestDataType.api
end

.authorize_url(params = {}) ⇒ Object



27
28
29
30
31
32
33
34
35
36
# File 'lib/paypal-sdk/core/openid_connect.rb', line 27

def authorize_url(params = {})
  uri = URI(url_for_mode(AUTHORIZATION_URL))
  uri.query = api.encode_www_form({
    :response_type => "code",
    :scope => DEFAULT_SCOPE,
    :client_id => RequestDataType.client_id,
    :redirect_uri => api.config.openid_redirect_uri
  }.merge(params))
  uri.to_s
end

.logout_url(params = {}) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/paypal-sdk/core/openid_connect.rb', line 38

def logout_url(params = {})
  uri = URI(url_for_mode(ENDSESSION_URL))
  uri.query = api.encode_www_form({
    :logout   => "true",
    :redirect_uri => api.config.openid_redirect_uri
  }.merge(params))
  uri.to_s
end

.set_config(*args) ⇒ Object Also known as: config=



18
19
20
# File 'lib/paypal-sdk/core/openid_connect.rb', line 18

def set_config(*args)
  RequestDataType.set_config(*args)
end