Generic Auth (Rest)

The Generic Auth (Rest) is an authentication provider typically used by an application or system to perform user authentication processes. In this case, the provider named Generic Auth (Rest) is used to manage authentication processes based on the REST API. It generically establishes a structure that can call the REST API's token.

You can add Generic Auth (REST) to the backend configuration of the app you've developed with Kuika.

1. Adding Generic Auth (REST) as an Authentication Provider

Click on the Configuration Manager view mode in the Header section. Name the Configuration Manager and create a new configuration setting.

Navigate to Authentication & Authorization in the App Settings. From there, proceed to the Authentication Provider section.

Click on ADD NEW in the Selectbox. Choose Generic Auth from the Type section. With Kuika, you can add Generic Auth(Rest) as an authentication provider to the apps you've developed.

To make settings on the Generic Auth (REST) screen, you should fill in the requested information.

  • Name your authentication provider using the text input box next to the Name title.

  • The next step for Generic Auth(Rest) is to set up the Token. There are some pieces of information to fill in within the Token Settings dropdown menu.

  • First, you need to provide the REST API URL entry to access user information.

  • The URL is the API URL that the user made public to get the Token. You can get the URL from Swagger.

  • The Content Type of the API returning the Token is selected accordingly.

  • application/json is a data transmission and storage format and is a media type or MIME type used for text-based data formats. JSON organizes data in key-value pairs. JSON data can include basic data types like objects, arrays, numbers, texts, boolean (true/false) values, and null values.

  • application/x-www-form-urlencoded is a media type (MIME type) for the encoded data form (form data) sent to servers by web browsers.

  • This type of encoding makes the data URL compliant, encoding characters like spaces and special characters that have specific meanings in URLs properly. For example, if a username is entered as "john_doe" and a password as "pass123", these form data can be sent as: username=john_doe&password=pass123

The Token's timeout duration is determined in the Expiration In Minutes section. Enter the Token's validity period numerically in the text box next to the “Expiration In Minutes” title. For instance, if 30min is entered, this value is entered. It is not converted.

  • Then, if there's an extra Header, Query, and Body parameter in the entered URL, add a parameter and enter parameter information as key and value pairs.

  • When Header is selected, it is used as a Header parameter when calling the Rest API. You can send authentication information using the "Authorization" title as a Header parameter. This title is used to transmit the necessary information to the authentication provider to verify your user identity.

  • When Query is selected, the query parameter is usually used to redirect the user to the authentication page or to transmit specific information during the authentication process. For example,

https://authorization-provider.com/login?client_id=abc123&redirect_uri=https://myapp.com/callback&scope=openid%20profile&response_type=code

  • When Body is selected, the Body parameter specifies a particular media type (MIME type). This determines how the Body will be processed and interpreted. For example, the application/json MIME type is used for an HTTP body containing JSON data, while the text/html MIME type can be used for an HTML page.

  • The Body is often used in POST and PUT Requests. When data needs to be sent to the server, the Body parameter is used. It is frequently used in data entry or update processes, especially in web forms.

  • Kuika allows automatically adding the username and password parameters. All you need to do is click on the ADD PARAMETERS button under the parameters header and select Custom, Username, and Password from the dropdown menu.

  • The Value information for Username and Password items is automatically filled by Kuika. You only need to specify the parameter type (Header, Query, Body) and keys.

  • Another piece of information you need to add for Generic Auth (Rest) is the Refresh Token settings. Refresh Token allows renewal processes to maintain access after timeouts.

  • You can set the Refresh Token through the Refresh Token Settings tab.

  • Firstly, enter the Refresh Token Url in the text box opposite the Token URL header.

  • Then, using the dropdown menu next to the URL Content Type header, select the URL content type.

  • If there are any additional Header, Query, and Body parameters in the entered Refresh Token URL, add the parameter and enter parameter information as a key and value pair.

  • Kuika allows automatic addition of Token and Refresh Token parameters. All you need to do is click on the ADD PARAMETERS button under the parameters header and select the Token and Refresh Token items from the dropdown menu.

  • The Value information for the Token and Refresh Token items is automatically filled by Kuika. You only need to specify the parameter type (Header, Query, Body) and keys.

  • Another piece of information you need to add for Generic Auth (Rest) is the Response information.

  • Execution of the entered Token details will result in a Response return. There is a need for some information to match the returned Response in Kuika.

  • This information includes Access Token, User Name, First Name, Last Name, and Refresh Token. You can access this information from the returned .json file.

  • If you have a Refresh Token, you can enter the Refresh Token information in the text box opposite the Refresh Token header under the Response.

After entering the required information, click on the CREATE button to establish the authentication provider.

Last updated