QueryRestOAuth
Make RESTful request to an endpoint with OAuth
Added in version 1.0.0.
Friendly name:
QueryRest: OAuthStep class:
base_steps_syncpack.steps.QueryRestOAuth.QueryRestOAuthStep version:
1.1.0Required parameters:
client_id,client_secret,token_url,method,prefix_url
Parameters
Name |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
yes |
– |
OAuth2 Client ID |
|
string |
yes |
– |
OAuth2 Client secret |
|
string |
yes |
– |
Full authentication URL including host and protocol. |
|
string |
no |
– |
Optional Full Token Revocation URL including host and protocol. |
|
boolean |
no |
|
Enable if your provider requires that you pass auth credentials in a Basic Auth Header |
|
string (long) |
no |
– |
Populate if the call needs to use a refresh token. |
|
array of strings |
no |
|
List of OAuth2 Scopes to apply |
|
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 |
|---|---|---|---|---|
|
enum |
yes |
– |
HTTP method to perform Example: |
|
string |
yes |
– |
used with relative_url to create the full URL. Example: |
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->SerializableSyncPack modules:
base_steps_syncpack.steps.QueryRESTExternal packages:
ipaascommon,ipaascore,isbaseutils,oauthlib,requests,requests_oauthlib
Behaviour
Extends QueryREST and wraps the request in an OAuth2 session:
Fetch a token — client-credentials grant by default, switching to the
refresh_tokengrant whenrefresh_tokenis populated.Run
QueryREST.execute()inside that session.Optionally revoke the token, if
revoke_urlis 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 useoauth_client_id/oauth_client_secret/oauth_token_url/oauth_scopes. Copying configuration between the two silently drops the credentials.client_id,client_secretandtoken_urlare all required — unlike the optionaloauth_*equivalents on the shared HTTP parameters.use_basic_authcontrols 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_methodset toOAuth, which also gets you token caching byoauth_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: