QueryRestOAuth

Make RESTful request to an endpoint with OAuth

Added in version 1.0.0.

  • Friendly name: QueryRest: OAuth

  • Step class: base_steps_syncpack.steps.QueryRestOAuth.QueryRestOAuth

  • Step version: 1.1.0

  • Required parameters: client_id, client_secret, token_url, method, prefix_url

Parameters

Name

Type

Required

Default

Description

client_id

string

yes

–

OAuth2 Client ID

client_secret

string

yes

–

OAuth2 Client secret

token_url

string

yes

–

Full authentication URL including host and protocol.

revoke_url

string

no

–

Optional Full Token Revocation URL including host and protocol.

use_basic_auth

boolean

no

False

Enable if your provider requires that you pass auth credentials in a Basic Auth Header

refresh_token

string (long)

no

–

Populate if the call needs to use a refresh token.

scopes

array of strings

no

[]

List of OAuth2 Scopes to apply

additional_auth_arguments

json

no

{}

Additional key-value pairs to pass to the authentication form.

Required inherited parameters

These are defined on QueryREST but are required here, so a working configuration must set them.

Name

Type

Required

Default

Description

method

enum

yes

–

HTTP method to perform Example: GET

prefix_url

string

yes

–

used with relative_url to create the full URL. Example: http://host.example.com

Other inherited parameters

This step also accepts 20 optional parameter(s) inherited from QueryREST.

Every step also accepts the platform parameters common to all steps – see Platform parameters.

Dependencies

  • Inherits from: QueryRestOAuth -> QueryREST -> BaseStep -> Serializable

  • SyncPack modules: base_steps_syncpack.steps.QueryREST

  • External packages: ipaascommon, ipaascore, isbaseutils, oauthlib, requests, requests_oauthlib

Behaviour

Extends QueryREST and wraps the request in an OAuth2 session:

  1. Fetch a token — client-credentials grant by default, switching to the refresh_token grant when refresh_token is populated.

  2. Run QueryREST.execute() inside that session.

  3. Optionally revoke the token, if revoke_url is set.

Refresh tokens are cached encrypted via IpaasContentManager, so a subsequent run can reuse them rather than re-authenticating.

Outputs

Identical to QueryREST.

Notes

  • The OAuth parameter names here are not the same as the ones on Shared parameters: HTTPBaseStep: this step uses client_id / client_secret / token_url / scopes, while the shared HTTP parameters use oauth_client_id / oauth_client_secret / oauth_token_url / oauth_scopes. Copying configuration between the two silently drops the credentials.

  • client_id, client_secret and token_url are all required — unlike the optional oauth_* equivalents on the shared HTTP parameters.

  • use_basic_auth controls only how credentials are presented during the token fetch, not how the API request itself is authenticated.

  • It inherits QueryREST, which is deprecated. Prefer GetREST / PostREST with auth_method set to OAuth, which also gets you token caching by oauth_cache_key.

API

class base_steps_syncpack.steps.QueryRestOAuth.QueryRestOAuth

Bases: QueryREST

load_refresh_token_from_cache(cache_key)

Loads and sets refresh_token value from cache using provided key.

Parameters:

cache_key (str) – key name where the refresh token is stored

save_refresh_token_to_cache(cache_key)

Save updated refresh_token to cache using provided key.

Parameters:

cache_key (str) – Cache key to store refresh token.

execute()

Main Query rest logic

Returns: