Library for for API authentication.
Included into RSTMOD. Can be used by other (e.g. customer-specific) modules that require HTTP-authentication.
Supported types:
* No authentication
* Basic - login/password
* X-CSRF-TOKEN - Cross-Site Request Forgery token
* OAuth 2.0
The module is very similar to RSTMOD in terms of design approaches
Property | YES/NO |
---|---|
Single page frame | No |
Show toolbar | No |
Show menu | No |
Show statusbar | No |
Show hint | No |
Fit panel size | No |
Name | Description | Data Type | Len | Dec. | View lines | View type | Inst. | Visible | Codetable |
---|---|---|---|---|---|---|---|---|---|
PANSTA | Panel Status 'E'dit 'I'nfo | Text | 1 | 1 | Edit | Yes | Public | ||
USR | User | Text | 40 | 1 | Edit | Yes | Public | ||
PWD | Password | Text | 40 | 1 | Edit | Yes | Public | ||
NAME | Name | Text | 100 | 1 | Edit | Yes | Public | ||
URL | Endpoint URL | Block | 64 | 32 | 4 | Block | Yes | Private | |
STMOUT | Output | Stream | 1 | 0 | Source | Yes | Public | ||
STMDBG | Debug | Stream | 1 | 0 | Source | Yes | Public | ||
SRVPNT | Parent Module of the Instance | Text | 10 | 1 | Edit | Yes | Public | ||
FMT | Format | Text | 4 | 1 | Edit | Yes | Public | Embedded | |
BUTTST | Get Token | Control | 16 | 1 | Button | Yes | Public | ||
TAGTKN | JSON tag of token | Text | 40 | 1 | Edit | Yes | Public | ||
HDRNAM | Name of headertag for token | Text | 40 | 1 | Edit | Yes | Public | ||
AUTHTYP | Authorization type | Text | 10 | 1 | Edit | Yes | Public | Embedded | |
USRLBL | User Label | Text | 40 | 1 | Edit | Yes | Public | ||
PWDLBL | Password Label | Text | 40 | 1 | Edit | Yes | Public | ||
BUTBACK | Back | Control | 16 | 1 | Button | Yes | Public | ||
LBLVBS | Label for Verbose Folder | Text | 100 | 1 | Edit | Yes | Private | ||
DBGSAV | Save Debug Info | Text | 1 | 1 | Edit | Yes | Public | ||
REQSAV | Save Request | Text | 1 | 1 | Edit | Yes | Public | ||
RESSAV | Save Response | Text | 1 | 1 | Edit | Yes | Public | ||
CLIID | Client Id | Text | 40 | 1 | Edit | Yes | Public | ||
CLISEC | Client Secret | Text | 40 | 1 | Edit | Yes | Public | ||
CURURL | Current URL for calling | Block | 64 | 32 | Block | Yes | Private | ||
PARURL | Parameters for URL | Block | 64 | 32 | Block | Yes | Private | ||
SRVNAM | Rest Instance Name | Text | 10 | 1 | Edit | Yes | Private | ||
FMTREQ | Request Content Type | Text | 4 | 1 | Edit | Yes | Public | Embedded | |
FMTRES | Response Content Type | Text | 4 | 1 | Edit | Yes | Public | Embedded | |
GNTTYP | Grant Type | Text | 6 | 1 | Edit | Yes | Public | Embedded | |
SCP | Scope | Text | 80 | 1 | Edit | Yes | Public |
This field is used for User for Basic and CSRF authentication types
For OAuth 2.0 this field is used for client ID
This field is used for Password for Basic and CSRF authentication types
For OAuth 2.0 this field is used for client secret
Indicates the name of panel for authentication settings. Derived from parent module
URL for base endpoint. Used for retrieving security tokens.
Maximum size 2048
Response from security endpoint
Code | Text |
---|---|
XML | text/xml |
JSON | application/json |
Authentication type. See embedded codetable for supported types
Code | Text |
---|---|
CSRF | X-CSRF-TOKEN |
OAUTH2 | OAuth 2.0 |
No Authorization | |
BASIC | Basic |
When set to non-empty - debug info after API call can be found in stream DBGSTM and saved in debug folder
For the folder - see function SYSTDC.GetVerboseFolder
When set to non-empty - request of API call is saved to debug folder.
For the folder - see function SYSTDC.GetVerboseFolder
When set to non-empty - response of API call is saved to debug folder.
For the folder - see function SYSTDC.GetVerboseFolder
Contains current URL.
To get current URL - use GetURI
Includes parameters of URL
To add parameter - use function AddParToUrl
Code | Text |
---|---|
XML | text/xml |
JSON | application/json |
UENC | application/x-www-form-urlencoded |
Code | Text |
---|---|
XML | text/xml |
JSON | application/json |
Code | Text |
---|---|
No Grant Type | |
CLICRD | client_credentials |
Panel | Type | Description |
---|---|---|
AUTHPAN | FramePanel | Authorization Settings |
BASICP | FramePanel | Authorization Settings - Basic |
CSRFP | FramePanel | Authorization Settings - CSRF |
OAUTH2P | FramePanel | Authorization Settings - OAUTHV2 |
Property | Value |
---|---|
Width | 788 |
Height | 528 |
Popup position-X | 0 |
Popup position-Y | 0 |
Visible | No |
Read only | No |
Show toolbar | No |
Instanciated | Yes |
Popup panel | No |
Global | No |
Property | Value |
---|---|
Width | 490 |
Height | 300 |
Popup position-X | 0 |
Popup position-Y | 0 |
Visible | No |
Read only | No |
Show toolbar | No |
Instanciated | No |
Popup panel | No |
Global | No |
Property | Value |
---|---|
Width | 490 |
Height | 300 |
Popup position-X | 0 |
Popup position-Y | 0 |
Visible | Yes |
Read only | No |
Show toolbar | No |
Instanciated | No |
Popup panel | No |
Global | No |
Property | Value |
---|---|
Width | 580 |
Height | 390 |
Popup position-X | 0 |
Popup position-Y | 0 |
Visible | Yes |
Read only | No |
Show toolbar | No |
Instanciated | No |
Popup panel | No |
Global | No |
Rule | Name | Additional |
---|---|---|
function | GetCsrfToken | text method |
function | GetOauth2Token | text method |
function | GetSecurityToken | text method |
function | GetURI | text method |
sub | AddParToUrl | method |
sub | AddToURL | method |
sub | ClearIrrelevantFields | method |
sub | LoadSettings | method |
sub | LoadSettingsCus | method |
sub | SaveSettings | method |
sub | SaveSettingsCus | method |
Gets new X-CSRF security token via given parameters:
Gets new OAuth 2.0 security token via given parameters:
Returns security token from the statically defined endpoint
To get security token without endpoint statically configured - use methods:
GetCsrfToken, GetOauth2Token
Returns complete URI of the endpoint including all parameters and added nodes
Adds parameter + value to URL for REST API calling
Corresponding functions: RestGet, RestPost, RestPut, RestDelete, AddToURL
Adds node to URL
Corresponding functions: RestGet, RestPost, RestPut, RestDelete, AddParToURL
custom function to extend LoadSettings functionality
custom function to extend SaveSettings functionality
Module class | Instance | Comment |
---|---|---|
ENCMOD | ENCMOD | |
XMLMOD | XMLMOD | |
SYSTDC | SYSTDC |