Custom Authorization Provider

Custom Authorization Provider is a structure used to create a customized authentication and authorization system. It is used to determine the user's roles within the application and allows you to determine which roles users have on the web or mobile side at the opening of each screen within the application by taking from different systems (for example, Azure, custom databases, etc.).

You can follow these steps to create Custom Authorization Provider:

  1. Select “C#” (1) as the Data Sources data source type, enter a name (2).
  2. Then select the “Custom Authorization Provider” method.
  3. Then click on the “CREATE” (3) button.

The Custom Authorization Provider you created represents a C# class that manages user authentication and authorization.

Kuika provides a ready-made C# predefined function in Custom Authorization for the user. This function contains the following methods and variables:

Get Roles Method:

The Get Roles method returns which roles the user has in the application. This method takes the following parameters:

  • App Id: The unique ID (GUID) of the app.
  • App Name: The name of the app.
  • Screen Id: Unique screen-specific ID (GUID).
  • Screen Name: The name of the screen.
  • User Name: The user's email address or ID.

return null; This line should be used if this particular authentication system does not want to customize application roles. In this case, the default system behavior is preserved and no custom role is assigned to the user.

The comments provided in the code contain important information about how the code should be used. In particular, they indicate that if it is desired to define developer-specific roles, the relevant script should be opened and the list of appropriate roles should be inserted instead of the code fragment specified here.

It can be used to customize the authentication and authorization processes of an application. For example, you may want to define special roles for workers on a particular screen or application partition. This class can be used to meet such requirements and provides developers with a starting point for customizing roles.