Class: Cerca::Resources::OAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/cerca/resources/oauth.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ OAuth

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OAuth.

Parameters:



40
41
42
# File 'lib/cerca/resources/oauth.rb', line 40

def initialize(client:)
  @client = client
end

Instance Method Details

#connect(provider, owner:, return_origin:, scopes: nil, request_options: {}) ⇒ Cerca::Models::OAuthConnectResponse

Some parameter documentations has been truncated, see Models::OAuthConnectParams for more details.

Start OAuth authorization

Parameters:

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/cerca/resources/oauth.rb', line 26

def connect(provider, params)
  parsed, options = Cerca::OAuthConnectParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["oauth/connect/%1$s", provider],
    body: parsed,
    model: Cerca::OAuthConnectResponse,
    options: options
  )
end