No items found.

Custom External Token Validator Provider

The Custom External Token Validator Provider enables the validation and interpretation of tokens generated by external identity providers (SSO, external authentication services, mobile token services, etc.) within Kuika. This provider allows access tokens originating from outside Kuika to be verified, ensuring user information is securely transferred to the system.

  • If the application uses an external identity verification system (SSO, OAuth-based services, custom auth services),
  • If users log in to Kuika with an external token instead of a username + password,
  • If you want to check the validity of tokens coming from mobile applications, gateways, or third-party systems, you can use it.

Creation Steps

  1. Select the C# data source and enter a name.
  2. Select the Custom External Token Validator Provider method.
  3. Click the CREATE button.

Custom External Token Validator Class

The Custom External Token Validator class implements the IExternalTokenValidator interface and manages the external token validation process coming to Kuika.

public class CustomExternalTokenValidator : IExternalTokenValidator

TokenProviderType Property

public EExternalTokenProviderTypes TokenProviderType =>EExternalTokenProviderTypes.External1;
  • Specifies the external token provider to be used.
  • Can take values between External1 and External5.
  • The default value is External1.
  • It should not be changed unless necessary.

Validate Method

public ExternalTokenResult Validate(ExternalTokenRequest request)

Used to check the validity of the external token received by Kuika and return the user information as the validation result.

Tasks:

  • Validate the validity of the incoming TokenString value
  • Identify the user associated with the token
  • Return the identity information that Kuika will use

Example Return:

return new ExternalTokenResult(){RefreshToken = request.RefreshToken,Token = request.TokenString,UserName = request.Username,Name = null,Surname = null,PhoneNumber = null};

Fields returning null are considered invalid by Kuika. Non-null fields are actively used in Kuika.

RefreshToken Method

public ExternalTokenResult RefreshToken(ExternalRefreshTokenRequest request)

Enables tokens that have expired or need to be renewed to be updated via the refresh token.

Tasks:

  • Verify the validity of the refresh token
  • Return new or updated token information to Kuika

Example Return:

return new ExternalTokenResult(){RefreshToken = request.RefreshToken,Token = request.TokenString};