Tokens
A central component of the SDK is managing authorization and authentication tokens for several use cases.
fetch_token_by_type
fetch_token_by_type Allows to fetch a specific type of token, providing search parameters to further classify which token to return (e.g. the subscription id for a Subscription Receipt Token).
The result is a TokenSearchResult or an error if the token could not be fetched.
let search_options = TokenSearchOptions(
subscriptionId: "1",
ipAddress: nil,
endpointConfiguration: nil,
forceRefresh: false);
let result = kapeSdkManger.tokens().fetchTokenByType(
tokenType: TokenNames.subscriptionReceiptToken,
advancedSearchOptions: search_options)val searchOptions = AdvancedSearchOptions(
subscriptionId = "1",
ipAddress = null,
endpointConfiguration = null,
forceRefresh = false
)
val result = kapeSdkManager.tokens().fetchTokenByType(
tokenType = TokenNames.subscriptionReceiptToken,
advancedSearchOptions = searchOptions
)token_type
TokenName
Type of the token to fetch
advanced_search_option
TokenSearchOptions optional
Depending on the type of tokens, this parameter is required and will contain additional options to search for the desired token
enumerate_tokens
enumerate_tokensEnumerates all tokens in the cache and returns an array of TokenSearchResult.
TokenSearchResult
subscription_id
String optional
The subscription id, this token belongs to
raw_token_data
String
The raw token data (usually JWT format)
token_meta_data
TokenMetaData optional
Optional additional meta-information about that token
token_name
TokenName
The type of token, see list below
See the different token types to learn more about the available options:
Last updated