Custom Authorization Provider

The Custom Authorization Provider is used to create a customized authentication and authorization system.

To create a Custom Authorization Provider, click on Datasources from the Header section. On the opened screen, click on the + icon on the left. Then select C# from the Select Type area. Name the Datasource you created. Choose Custom Authorization Provider from the Selectbox and click the Create button.

The Custom Authorization Provider represents a custom authentication class. It is used to obtain a user's roles within the application. Within the application, at the start of every screen, Custom Authorization provides the ability to get which roles are assigned for each user from different systems (Azure, Custom DB, etc.) either on the Web or Mobile side.

Kuika offers a pre-defined C# function within Custom Authorization for users. The following methods and variables are included in this function:

GetRoles Method

The GetRoles method returns which roles the user has within the application. This method takes the following parameters:

  • appId: The unique identity of the application (GUID).

  • appName: The name of the application.

  • screenId: The unique identity specific to the screen (GUID).

  • screenName: The name of the screen.

  • userName: The user's email address or identity.

  • return null; line: If this custom authentication system does not want to customize application roles, this line should be used. In this case, the default system behavior is maintained, and no specific role is assigned to the user.

Comments provided in the code contain crucial information about how to use the code. Specifically, developers are instructed to open the relevant code and add an appropriate list of roles in place of the specified code snippet if custom roles are desired.

This code can be used to customize the authentication and authorization processes of an application. For instance, you may want to define special roles for employees on a specific screen or app section. This class can be used to meet such requirements and provides developers with a starting point to customize roles.

Last updated