Class: Zyphr::AuthOAuthApi
- Inherits:
-
Object
- Object
- Zyphr::AuthOAuthApi
- Defined in:
- lib/zyphr/api/auth_o_auth_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#complete_o_auth_link(provider, o_auth_callback_request, opts = {}) ⇒ OAuthLinkResponse
Complete linking an OAuth provider to the current account Complete an authenticated account-linking flow started via the link authorize endpoint.
-
#complete_o_auth_link_with_http_info(provider, o_auth_callback_request, opts = {}) ⇒ Array<(OAuthLinkResponse, Integer, Hash)>
Complete linking an OAuth provider to the current account Complete an authenticated account-linking flow started via the link authorize endpoint.
-
#disconnect_o_auth_provider(provider, opts = {}) ⇒ SuccessResult
Disconnect OAuth provider Disconnect an OAuth provider from the current user.
-
#disconnect_o_auth_provider_with_http_info(provider, opts = {}) ⇒ Array<(SuccessResult, Integer, Hash)>
Disconnect OAuth provider Disconnect an OAuth provider from the current user.
-
#get_o_auth_authorization_url(provider, redirect_uri, opts = {}) ⇒ OAuthAuthorizationUrlResponse
Get OAuth authorization URL Generate an OAuth authorization URL for the specified provider.
-
#get_o_auth_authorization_url_with_http_info(provider, redirect_uri, opts = {}) ⇒ Array<(OAuthAuthorizationUrlResponse, Integer, Hash)>
Get OAuth authorization URL Generate an OAuth authorization URL for the specified provider.
-
#get_o_auth_connection_info(provider, opts = {}) ⇒ OAuthConnectionInfoResponse
Get OAuth connection info Get OAuth connection info for a specific provider (without tokens).
-
#get_o_auth_connection_info_with_http_info(provider, opts = {}) ⇒ Array<(OAuthConnectionInfoResponse, Integer, Hash)>
Get OAuth connection info Get OAuth connection info for a specific provider (without tokens).
-
#get_o_auth_tokens(provider, user_id, opts = {}) ⇒ OAuthTokensResponse
Get OAuth provider tokens Get OAuth provider tokens for an end user.
-
#get_o_auth_tokens_with_http_info(provider, user_id, opts = {}) ⇒ Array<(OAuthTokensResponse, Integer, Hash)>
Get OAuth provider tokens Get OAuth provider tokens for an end user.
-
#handle_o_auth_callback(provider, o_auth_callback_request, opts = {}) ⇒ OAuthCallbackResponse
Handle OAuth callback Handle the OAuth callback by exchanging the authorization code for tokens and authenticating the user.
-
#handle_o_auth_callback_with_http_info(provider, o_auth_callback_request, opts = {}) ⇒ Array<(OAuthCallbackResponse, Integer, Hash)>
Handle OAuth callback Handle the OAuth callback by exchanging the authorization code for tokens and authenticating the user.
-
#initialize(api_client = ApiClient.default) ⇒ AuthOAuthApi
constructor
A new instance of AuthOAuthApi.
-
#list_o_auth_connections(opts = {}) ⇒ OAuthConnectionsResponse
List OAuth connections Get OAuth connections for the current user with metadata.
-
#list_o_auth_connections_with_http_info(opts = {}) ⇒ Array<(OAuthConnectionsResponse, Integer, Hash)>
List OAuth connections Get OAuth connections for the current user with metadata.
-
#list_o_auth_providers(opts = {}) ⇒ OAuthProvidersResponse
List OAuth providers Get list of enabled OAuth providers for the application.
-
#list_o_auth_providers_with_http_info(opts = {}) ⇒ Array<(OAuthProvidersResponse, Integer, Hash)>
List OAuth providers Get list of enabled OAuth providers for the application.
-
#refresh_o_auth_tokens(provider, refresh_o_auth_tokens_request, opts = {}) ⇒ OAuthTokensRefreshResponse
Refresh OAuth provider tokens Refresh OAuth provider tokens for an end user.
-
#refresh_o_auth_tokens_with_http_info(provider, refresh_o_auth_tokens_request, opts = {}) ⇒ Array<(OAuthTokensRefreshResponse, Integer, Hash)>
Refresh OAuth provider tokens Refresh OAuth provider tokens for an end user.
-
#start_o_auth_link(provider, redirect_uri, opts = {}) ⇒ OAuthAuthorizeResponse
Start linking an OAuth provider to the current account Begin an authenticated account-linking flow.
-
#start_o_auth_link_with_http_info(provider, redirect_uri, opts = {}) ⇒ Array<(OAuthAuthorizeResponse, Integer, Hash)>
Start linking an OAuth provider to the current account Begin an authenticated account-linking flow.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AuthOAuthApi
Returns a new instance of AuthOAuthApi.
19 20 21 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#complete_o_auth_link(provider, o_auth_callback_request, opts = {}) ⇒ OAuthLinkResponse
Complete linking an OAuth provider to the current account Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
28 29 30 31 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 28 def complete_o_auth_link(provider, o_auth_callback_request, opts = {}) data, _status_code, _headers = complete_o_auth_link_with_http_info(provider, o_auth_callback_request, opts) data end |
#complete_o_auth_link_with_http_info(provider, o_auth_callback_request, opts = {}) ⇒ Array<(OAuthLinkResponse, Integer, Hash)>
Complete linking an OAuth provider to the current account Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 39 def complete_o_auth_link_with_http_info(provider, o_auth_callback_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.complete_o_auth_link ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.complete_o_auth_link" end # verify the required parameter 'o_auth_callback_request' is set if @api_client.config.client_side_validation && o_auth_callback_request.nil? fail ArgumentError, "Missing the required parameter 'o_auth_callback_request' when calling AuthOAuthApi.complete_o_auth_link" end # resource path local_var_path = '/auth/oauth/{provider}/link/callback'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(o_auth_callback_request) # return_type return_type = opts[:debug_return_type] || 'OAuthLinkResponse' # auth_names auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.complete_o_auth_link", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#complete_o_auth_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#disconnect_o_auth_provider(provider, opts = {}) ⇒ SuccessResult
Disconnect OAuth provider Disconnect an OAuth provider from the current user.
101 102 103 104 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 101 def disconnect_o_auth_provider(provider, opts = {}) data, _status_code, _headers = disconnect_o_auth_provider_with_http_info(provider, opts) data end |
#disconnect_o_auth_provider_with_http_info(provider, opts = {}) ⇒ Array<(SuccessResult, Integer, Hash)>
Disconnect OAuth provider Disconnect an OAuth provider from the current user.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 111 def disconnect_o_auth_provider_with_http_info(provider, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.disconnect_o_auth_provider ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.disconnect_o_auth_provider" end # resource path local_var_path = '/auth/oauth/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SuccessResult' # auth_names auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.disconnect_o_auth_provider", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#disconnect_o_auth_provider\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_o_auth_authorization_url(provider, redirect_uri, opts = {}) ⇒ OAuthAuthorizationUrlResponse
Get OAuth authorization URL Generate an OAuth authorization URL for the specified provider.
165 166 167 168 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 165 def (provider, redirect_uri, opts = {}) data, _status_code, _headers = (provider, redirect_uri, opts) data end |
#get_o_auth_authorization_url_with_http_info(provider, redirect_uri, opts = {}) ⇒ Array<(OAuthAuthorizationUrlResponse, Integer, Hash)>
Get OAuth authorization URL Generate an OAuth authorization URL for the specified provider.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 176 def (provider, redirect_uri, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.get_o_auth_authorization_url ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.get_o_auth_authorization_url" end # verify the required parameter 'redirect_uri' is set if @api_client.config.client_side_validation && redirect_uri.nil? fail ArgumentError, "Missing the required parameter 'redirect_uri' when calling AuthOAuthApi.get_o_auth_authorization_url" end # resource path local_var_path = '/auth/oauth/{provider}/authorize'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'redirect_uri'] = redirect_uri # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OAuthAuthorizationUrlResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.get_o_auth_authorization_url", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#get_o_auth_authorization_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_o_auth_connection_info(provider, opts = {}) ⇒ OAuthConnectionInfoResponse
Get OAuth connection info Get OAuth connection info for a specific provider (without tokens). Safe for public key authentication.
234 235 236 237 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 234 def get_o_auth_connection_info(provider, opts = {}) data, _status_code, _headers = get_o_auth_connection_info_with_http_info(provider, opts) data end |
#get_o_auth_connection_info_with_http_info(provider, opts = {}) ⇒ Array<(OAuthConnectionInfoResponse, Integer, Hash)>
Get OAuth connection info Get OAuth connection info for a specific provider (without tokens). Safe for public key authentication.
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 244 def get_o_auth_connection_info_with_http_info(provider, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.get_o_auth_connection_info ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.get_o_auth_connection_info" end # resource path local_var_path = '/auth/oauth/connections/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OAuthConnectionInfoResponse' # auth_names auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.get_o_auth_connection_info", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#get_o_auth_connection_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_o_auth_tokens(provider, user_id, opts = {}) ⇒ OAuthTokensResponse
Get OAuth provider tokens Get OAuth provider tokens for an end user. Requires secret key authentication (server-side only). This allows developers to access downstream APIs on behalf of their users.
298 299 300 301 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 298 def get_o_auth_tokens(provider, user_id, opts = {}) data, _status_code, _headers = get_o_auth_tokens_with_http_info(provider, user_id, opts) data end |
#get_o_auth_tokens_with_http_info(provider, user_id, opts = {}) ⇒ Array<(OAuthTokensResponse, Integer, Hash)>
Get OAuth provider tokens Get OAuth provider tokens for an end user. Requires secret key authentication (server-side only). This allows developers to access downstream APIs on behalf of their users.
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 309 def get_o_auth_tokens_with_http_info(provider, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.get_o_auth_tokens ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.get_o_auth_tokens" end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling AuthOAuthApi.get_o_auth_tokens" end # resource path local_var_path = '/auth/oauth/tokens/{provider}'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'user_id'] = user_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OAuthTokensResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.get_o_auth_tokens", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#get_o_auth_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#handle_o_auth_callback(provider, o_auth_callback_request, opts = {}) ⇒ OAuthCallbackResponse
Handle OAuth callback Handle the OAuth callback by exchanging the authorization code for tokens and authenticating the user.
368 369 370 371 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 368 def handle_o_auth_callback(provider, o_auth_callback_request, opts = {}) data, _status_code, _headers = handle_o_auth_callback_with_http_info(provider, o_auth_callback_request, opts) data end |
#handle_o_auth_callback_with_http_info(provider, o_auth_callback_request, opts = {}) ⇒ Array<(OAuthCallbackResponse, Integer, Hash)>
Handle OAuth callback Handle the OAuth callback by exchanging the authorization code for tokens and authenticating the user.
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 379 def handle_o_auth_callback_with_http_info(provider, o_auth_callback_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.handle_o_auth_callback ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.handle_o_auth_callback" end # verify the required parameter 'o_auth_callback_request' is set if @api_client.config.client_side_validation && o_auth_callback_request.nil? fail ArgumentError, "Missing the required parameter 'o_auth_callback_request' when calling AuthOAuthApi.handle_o_auth_callback" end # resource path local_var_path = '/auth/oauth/{provider}/callback'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(o_auth_callback_request) # return_type return_type = opts[:debug_return_type] || 'OAuthCallbackResponse' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"AuthOAuthApi.handle_o_auth_callback", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#handle_o_auth_callback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_o_auth_connections(opts = {}) ⇒ OAuthConnectionsResponse
List OAuth connections Get OAuth connections for the current user with metadata.
440 441 442 443 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 440 def list_o_auth_connections(opts = {}) data, _status_code, _headers = list_o_auth_connections_with_http_info(opts) data end |
#list_o_auth_connections_with_http_info(opts = {}) ⇒ Array<(OAuthConnectionsResponse, Integer, Hash)>
List OAuth connections Get OAuth connections for the current user with metadata.
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 449 def list_o_auth_connections_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.list_o_auth_connections ...' end # resource path local_var_path = '/auth/oauth/connections' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OAuthConnectionsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.list_o_auth_connections", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#list_o_auth_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_o_auth_providers(opts = {}) ⇒ OAuthProvidersResponse
List OAuth providers Get list of enabled OAuth providers for the application.
497 498 499 500 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 497 def list_o_auth_providers(opts = {}) data, _status_code, _headers = list_o_auth_providers_with_http_info(opts) data end |
#list_o_auth_providers_with_http_info(opts = {}) ⇒ Array<(OAuthProvidersResponse, Integer, Hash)>
List OAuth providers Get list of enabled OAuth providers for the application.
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 506 def list_o_auth_providers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.list_o_auth_providers ...' end # resource path local_var_path = '/auth/oauth/providers' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OAuthProvidersResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.list_o_auth_providers", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#list_o_auth_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#refresh_o_auth_tokens(provider, refresh_o_auth_tokens_request, opts = {}) ⇒ OAuthTokensRefreshResponse
Refresh OAuth provider tokens Refresh OAuth provider tokens for an end user. Requires secret key authentication (server-side only). Only supported for providers that support token refresh (e.g., Google, Microsoft).
556 557 558 559 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 556 def refresh_o_auth_tokens(provider, refresh_o_auth_tokens_request, opts = {}) data, _status_code, _headers = refresh_o_auth_tokens_with_http_info(provider, refresh_o_auth_tokens_request, opts) data end |
#refresh_o_auth_tokens_with_http_info(provider, refresh_o_auth_tokens_request, opts = {}) ⇒ Array<(OAuthTokensRefreshResponse, Integer, Hash)>
Refresh OAuth provider tokens Refresh OAuth provider tokens for an end user. Requires secret key authentication (server-side only). Only supported for providers that support token refresh (e.g., Google, Microsoft).
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 567 def refresh_o_auth_tokens_with_http_info(provider, refresh_o_auth_tokens_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.refresh_o_auth_tokens ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.refresh_o_auth_tokens" end # verify the required parameter 'refresh_o_auth_tokens_request' is set if @api_client.config.client_side_validation && refresh_o_auth_tokens_request.nil? fail ArgumentError, "Missing the required parameter 'refresh_o_auth_tokens_request' when calling AuthOAuthApi.refresh_o_auth_tokens" end # resource path local_var_path = '/auth/oauth/tokens/{provider}/refresh'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(refresh_o_auth_tokens_request) # return_type return_type = opts[:debug_return_type] || 'OAuthTokensRefreshResponse' # auth_names auth_names = opts[:debug_auth_names] || ['ApplicationSecret', 'ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.refresh_o_auth_tokens", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#refresh_o_auth_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#start_o_auth_link(provider, redirect_uri, opts = {}) ⇒ OAuthAuthorizeResponse
Start linking an OAuth provider to the current account Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
630 631 632 633 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 630 def start_o_auth_link(provider, redirect_uri, opts = {}) data, _status_code, _headers = start_o_auth_link_with_http_info(provider, redirect_uri, opts) data end |
#start_o_auth_link_with_http_info(provider, redirect_uri, opts = {}) ⇒ Array<(OAuthAuthorizeResponse, Integer, Hash)>
Start linking an OAuth provider to the current account Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 |
# File 'lib/zyphr/api/auth_o_auth_api.rb', line 641 def start_o_auth_link_with_http_info(provider, redirect_uri, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuthOAuthApi.start_o_auth_link ...' end # verify the required parameter 'provider' is set if @api_client.config.client_side_validation && provider.nil? fail ArgumentError, "Missing the required parameter 'provider' when calling AuthOAuthApi.start_o_auth_link" end # verify the required parameter 'redirect_uri' is set if @api_client.config.client_side_validation && redirect_uri.nil? fail ArgumentError, "Missing the required parameter 'redirect_uri' when calling AuthOAuthApi.start_o_auth_link" end # resource path local_var_path = '/auth/oauth/{provider}/link'.sub('{' + 'provider' + '}', CGI.escape(provider.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'redirect_uri'] = redirect_uri # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'OAuthAuthorizeResponse' # auth_names auth_names = opts[:debug_auth_names] || ['EndUserToken', 'ApplicationPublicKey'] = opts.merge( :operation => :"AuthOAuthApi.start_o_auth_link", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuthOAuthApi#start_o_auth_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |