Class: Cerca::Resources::OAuth
- Inherits:
-
Object
- Object
- Cerca::Resources::OAuth
- Defined in:
- lib/cerca/resources/oauth.rb
Instance Method Summary collapse
-
#connect(provider, owner:, return_origin:, scopes: nil, request_options: {}) ⇒ Cerca::Models::OAuthConnectResponse
Some parameter documentations has been truncated, see Models::OAuthConnectParams for more details.
-
#initialize(client:) ⇒ OAuth
constructor
private
A new instance of OAuth.
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.
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
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cerca/resources/oauth.rb', line 26 def connect(provider, params) parsed, = Cerca::OAuthConnectParams.dump_request(params) @client.request( method: :post, path: ["oauth/connect/%1$s", provider], body: parsed, model: Cerca::OAuthConnectResponse, options: ) end |