Skip to content

Token Service

TokenService provides methods to define and resolve Custom tokens. You can use these tokens with:

  • HttpService to reference tokens in the URL of an External Connection record.
  • QueryService to reference tokens in a VQL query.
  • QueueService to reference tokens in Spark messages.

You can define custom tokens using TokenRequest.Builder as shown in the example below.

TokenService tokenService = ServiceLocator.locate(TokenService.class); TokenRequest.Builder builder = tokenService.newTokenRequestBuilder(); builder.withValue("Custom.api_version", "1.0"); builder.withValue("Custom.is_case_sensitive", Boolean.TRUE); builder.withValue("Custom.max_amount", new BigDecimal(100)); TokenRequest tokenRequest = builder.build();

TokenService can only be used for Custom tokens. For Authorization tokens and Session tokens, use HttpService. For Vault tokens, use HttpService, QueryService, or QueueService.