Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

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:

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}

Opis konfiguracji:

Name of the parameterDescriptionOptionality
TokenThe value of the token to be forwarder into the headerRequired

Cookie

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

Opis konfiguracji:

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:

KonfiguracjaWynik
Dołączy do żądań ze źródła danych ciasteczko autoryzacyjne z systemu PlusWorkflow
Dołączy do żądań ze źródła danych ciasteczko autoryzacyjne z systemu PlusWorkflow

 

OAuth2

Szablon autoryzacji OAuth2 umożliwia dodanie do każdego żądania tokena OAuth w postaci odpowiedniego nagłówka lub parametru adresu URL.

Opis konfiguracji:

Nazwa parametruOpisWymagalność
Grant type

Określa czy żądanie autoryzujące ma zawierać tylko sekrety klienta, czy również informacje o użytkowniku. Dostępne wartości:

  • Client credentials - tylko sekrety klienta
  • Password credentials - sekrety klienta + informacje o użytkowniku
Wymagany
Access Token URLAdres URL, pod który wysłane zostanie żądanieWymagany
UsernameNazwa użytkownika. Dostępny jedynie w przypadku, gdy parametr "Grant type" ustawiony zostanie na wartość "Password credentials"Wymagany
PasswordHasło użytkownika. Dostępny jedynie w przypadku, gdy parametr "Grant type" ustawiony zostanie na wartość "Password credentials"Wymagany
Client IDhttps://www.oauth.com/oauth2-servers/client-registration/client-id-secret/Wymagany
Client Secrethttps://www.oauth.com/oauth2-servers/client-registration/client-id-secret/Wymagany
ScopeOpcjonalny parametr określający do jakich zasobów ma zostać udzielony dostęp. Wartość parametru zależy od konkretnego rozwiązania API, do którego łączyć się będzie źródło danychOpcjonalny
ResourceOpcjonalny parametr określający do jakich zasobów ma zostać udzielony dostęp. Wartość parametru zależy od konkretnego rozwiązania API, do którego łączyć się będzie źródło danychOpcjonalny
Autoryzacja klienta

Określa w jaki sposób mają zostać przekazane dane autoryzujące (sekrety klienta). Dostępne wartości:

  • Wyślij jako nagłówek Basic Auth,
  • Wyślij jako dane formularza w ciele żądania
Wymagany
Dodaj dane autoryzujące do

Określa w jaki sposób ma być przekazywany token autoryzujący (otrzymany w odpowiedzi na żądanie autoryzujące) przy kolejnych wywołaniach API. Dostępne wartości:

  • Nagłówka żądania
  • URL-a żądania
Wymagany

Przykład konfiguracji:

Modyfikacja szablonów autoryzacji

Szablony autoryzacji umożliwiają modyfikację wcześniej zapisanych szablonów. Aby tego dokonać należy na formularzy wybrać przycisk "Modyfikuj szablony autoryzacji".

Po kliknięciu ukaże się okno modyfikacji szablonu autoryzacji.

W otwartym oknie należy wybrać z listy rozwijanej zapisany szablon autoryzacji.

Po wybraniu szablonu formularz zostanie uzupełniony o dane w nim zapisane.

Po zakończeniu edycji danych należy wybrać przycisk "Modyfikuj szablon autoryzacji" w celu zapisania szablonu ze zmianami.

Nieużywany szablon można również usunąć z bazy za pomocą przycisku "Usuń".

  • No labels