Custom Authorization Provider

Custom Authorization Provider, is used to create a customised authentication and authorisation system.

To create Custom Authorisation Provider, click Datasources in the Header field. On the screen that opens, click the + icon on the left. Then select C# from the Select Type field. Name the Datasource you created. Select Custom Authorisation Provider from the Selectbox and click the Create button.

Custom Authorisation Provider represents a special authentication class. It is used to retrieve the user's roles within the application. Custom Authorisation allows Custom Authorisation to retrieve from different systems (Azure, Custom DB...) which roles are available for each user on the screen on the Web or Mobile side at the opening of each screen within the application.

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

GetRoles Method:

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

  • appId: The unique ID (GUID) of the application.
  • appName: Name of the app.
  • screenId:Display specific unique identification (GUID).
  • screenName: Name of the screen.
  • userName:The user's e-mail address or ID.
  • return null; satırı: This line will need to be used if this particular authentication system does not want to customise the application roles. In this case, the default system behaviour is retained and no custom role is assigned to the user.

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

This code can be used to customise the authentication and authorisation processes of an application. For example, you may want to define special roles for workers on a particular screen or application section. This class can be used to meet such requirements and provides developers with a starting point for customising roles.