WireGuard Session Token
Fetching a WireGuard Token
//Example Configuration
let endpointConfiguration = EndpointConfiguration.wireGuard(
ip: IpAddress.v4(ipV4: "194.62.107.176"),
port: 123,
authIp: IpAddress.v4(ipV4: "194.62.107.176"),
authPort: 443,
certDn: "Server-11882-5a",
obfuscation: WireguardObfuscation.none)
let search_options = TokenSearchOptions(
subscriptionId: "1",
ipAddress: nil,
endpointConfiguration: endpointConfiguration,
forceRefresh: false);
let result = kapeSdkManger.tokens().fetchTokenByType(
tokenType: TokenNames.wireGuardToken,
advancedSearchOptions: search_options)
//use the below values to establish the WireGuard VPN Connection
let psk = result.token_meta_data?.wireguard_auth?.psk ?? ""
let server_public_key = result.token_meta_data?.wireguard_auth?.server_public_key ?? ""
let internal_ip = result.token_meta_data?.wireguard_auth?.internal_ip ?? ""
let client_private_key = result.token_meta_data?.wireguard_auth?.client_private_key ?? "" Last updated