Skip to end of metadata
Go to start of metadata

 

Authorization templates allow you to define a common authorization method for many RESTful API datasources.

The saved template can be used many times to configure subsequent datasources that communicate with the same API system.

Creating an authorization template:

To create an authorization template, select the "Create authorization template" button on the datasource form:

Then a window will appear with the configuration of the authorization template:

Description of the authorization template configuration:

Name of the parameterDescriptionOptionality
TemplateIt allows you to complete the configuration fields with one of the previously saved templates to speed up the configuration of many similar templates.Not applicable
IdUnique authorization template id.Required
NameAuthorization template display name.Required
DescriptionDisplayed description of the authorization template.Required
Authorization typeIt allows you to choose one of the available authorization types supported by the plugin. After selecting the authorization type, additional configuration fields specific to it will appear on the form. The list of available authorization types is given below.Required


Available authorization types:

 

Staritng from version 1.0.10, it is now possible to parameterize each authorization configuration using datasource input parameters. Use {param}, where param equals input parameter id to dynamically pass config param value.

 

 

API Key

The API Key authorization template allows you to add a permanent API key to each request. The key can be added to the URL in the format - ?key=value - or to the header in the format { headers: { key: value } }

Configuration description:

Name of the parameterDescriptionOptionality
KeyURL parameter key or header name (depending on the "Add to" parameter)Required
ValueURL parameter value or header value (depending on the "Add to" parameter)Required
Add toSpecifies whether to add the key to the request as a URL parameter or as a header.Required

Configuration examples:

ConfigurationResult

It will add the request parameter provided in the source configuration to the URL ?token=ASDF

Eg. http://localhost:8080 => http://localhost:8080?token=ASDF

It will add following header to the request "API-KEY: someConstantToken"

Basic Auth

The Basic Auth authorization template allows you to add a Basic Auth header to each request in the form: Authorization: Basic {credentials}, where {credentials} is the Base64 value calculated from: {Użytkownik}:{Hasło}.

Configuration description:

Name of the parameterDescriptionOptionality
UserName of the user registered in the APIRequired
PasswordUser passwordRequired

Bearer Token

The Bearer Token authorization template allows you to add a Basic Auth header to each request in the form: Authorization: Bearer {token}

Configuration description:

NameDescriptionRequirement
Token sourceDropdown list. Available options: "Datasource","Constant value".Required
TokenToken value to add in authorization header.Required (only for "Token source" == "Constant value")
Datasource IDDatasource which returns token value (first returned value is being used).Required (only for "Token source" == "Datasource")
Datasource parametersDatasource input parameters. Format: "parameter_1=value_1, parameter_2=value_2".Optional

Cookie

The Cookie authorization template allows you to add to each request the cookie required to authorize the request.

Configuration description:

Name of the parameterDescriptionOptionality
HTTP methodThe HTTP method to be used in the request; possible values: [GET, POST]Required
URLThe URL to which the request will be sent to receive cookies from the APIRequired
Content-TypeAvailable only after selecting the POST method. Available values: application/json, application/x-www-form-urlencoded, multipart/form-dataRequired
ParametersAvailable only after selecting the POST method. Parameters passed in the body of the request.Optional

Configuration examples:

ConfigurationResult
It will attach the authorization cookie from the PlusWorkflow system to requests from the datasource
It will attach the authorization cookie from the PlusWorkflow system to requests from the datasource

 

OAuth2

The OAuth2 authorization template allows you to add an OAuth token to each request as the appropriate header or URL parameter.

Configuration description:

Name of the parameterDescriptionOptionality
Grant type

Specifies whether the authorization request should contain only client secrets or client secrets + user credentials. Available values:

  • Client credentials - only client secrets
  • Password credentials - client secrets + user credentials
Required
Access Token URLURL to which the request will be sentRequired
UsernameUsername. Available only when the "Grant type" parameter is set to "Password credentials"Required
PasswordUser password. Available only when the "Grant type" parameter is set to "Password credentials"Required
Client IDhttps://www.oauth.com/oauth2-servers/client-registration/client-id-secret/Required
Client Secrethttps://www.oauth.com/oauth2-servers/client-registration/client-id-secret/Required
ScopeAn optional parameter that specifies which resources to grant access to. The value of the parameter depends on the specific API solution to which the data source will be connectedOptional
ResourceAn optional parameter that specifies which resources to grant access to. The value of the parameter depends on the specific API solution to which the data source will be connectedOptional
Client authorization

Specifies how authorization data (customer secrets) are to be transmitted. Available values:

  • Send as Basic Auth header,
  • Send client credentials in body
Required
Add authorization data to

Specifies how the authorization token (received in response to the authorization request) is to be forwarded on subsequent API calls. Available values:

  • Request Header
  • Request URL
Required

Configuration example:

NTLM

The NTLM (https://en.wikipedia.org/wiki/NTLM) authorization template.

Configuration

Parameter nameDescriptionRequired
UsernameThe name of the user trying to access a protected resource. This can be, for example, a Windows account login.Yes
PasswordThe user's password associated with their account. The password is used to verify the user's identity. In NTLM, the password is not sent directly over the network but is used to generate a hash, which is then used in the authentication process.Yes
DomainThe name of the domain in which the user account is registered. This can be an Active Directory domain or the local computer name if the user is logging into a local account.No
WorkstationThe name of the user's computer from which the authentication request originates.No

 

Modification of authorization templates

Authorization templates allow you to modify previously saved templates. To do this, select the "Modify authorization" button on the form.

After clicking, the authorization template modification window will appear.

In the opened window, select the saved authorization template from the drop-down list.

After selecting the template, the form will be filled with the data saved in it.

After editing the data, select the "Modify authorization" button to save the template with changes.

The unused template can also be removed from the database using the "Delete" button.

  • No labels
Write a comment…