기술 자료

​
​

Development

User Acquisition

Monetization

산업 분야

Vivox Core SDK

Vivox Core SDK

이 페이지는 선택한 언어로 제공되지 않습니다.
Vivox
​
​
Vivox Core SDK
  • Overview
  • Before you begin
  • Get started
    • Integration guide
    • Quick start guide
      • Initializing Vivox
      • Logging in
      • Assign a unique username
      • Generate a login access token
      • Submit a login request
      • Joining and leaving channels
      • Generate and submit a join token
      • Process join responses and events
      • Handle join errors
  • Release notes
  • Developer Guide
  • Reference
  • Privacy overview
  1. Vivox Core SDK documentation

Generate a login access token

How to form a login token on a game server.
읽는 시간 3분
최근 업데이트: 8달 전

The next step in the login process is to correctly form a login token on a game server. This step is important to understand as it contributes to a significant number of Vivox integration mistakes. Here are some key facts to understand Login Tokens in general:
  • Login tokens can only be used once.
  • Expiration timers are important; leave room for unforeseen circumstances such as slow internet connections or inactive instances.
    • Current best practice for expiration time is Time.Now + 90 seconds.
  • Your game will provide its own account names and login tokens.
  • There are three key sections to the login tokens:
    • Header
    • Payload
    • Signature

Login token - Header

In the case of Vivox, the header is empty to satisfy the JSON Web Token (JWT) standards. The header can be formed either as code or as a constant.

Code

Constant

base64URLencode(“{}”)An empty header should always resolve to “e30” when encoded, this can be stored as a constant in your code if it fits your needs.

Login token - Payload

Crafting a payload consists of a defined set of claims you make to the Vivox server. Your code can craft an object to store these claims. The claims apply to tokens other than login tokens, so they can be serialized and encoded when you submit your request to Vivox.

Explanation

Example claims object

N/Apublic class Claims {
Issuerpublic string iss {get;set;}
Expiration time in “epoch seconds”public int exp {get;set;}
Vivox Actionpublic string vxa {get;set;}
VXI is a claim that guarantees uniqueness, a simple incremented integer can be used.public int vxi {get;set;}
Full details on who the token is “from”public string f {get;set;}
Not used for login tokens.public string t {get;set;}
N/Apublic string sub {get;set;} }

Example login token

Claims loginClaim = new Claims{iss=issuer-ba63,vxi = 93000,vxa:login,exp=1600349400,f=sip:.issuer-ba63.030104_16.@tla.vivox.com };

Some best practices for token payloads

  • All information should be base64URLEncoded, this is different from base64encode.
  • Current best practice for expiration time is Time.Now + 90 seconds.
  • VXI is a claim that guarantees uniqueness, a simple incremented integer can be used.

Login token - Signature

The signature combines the header and payload into a signed hash-based message authentication code (HMAC) which is then encoded. This is where the key provided by Vivox is used to protect your service and authenticate your communication.
To form this HMAC:
  1. Join your encoded header and encoded payload together with a period.
  2. Process the result through an HMACSHA256 process.
  3. Use the “secret” provided in your Vivox Developer Portal credentials as the signing key in the HMAC process/method.
A pseudo-code example of this can be found on the Access token signature page.
Your final result should resemble this example:
e30.eyJpc3MiOiJibGluZG1lbG9uLUFwcE5hbWUtZGV2IiwidnhhIjoibG9naW4iLCJ2eGkiOjkzMzAwMCwiZXhwIjoxNjAwMzQ5NDAwLCJmIjoic2lwOi5ibGluZG1lbG9uLUFwcE5hbWUtZGV2Lmplcmt5LkB0bGEudml2b3guY29tIn0.5FKsAQz7bRQGGlSZw-KIcCmft7Ic6nT3Ih-TbdYPWwI
Color guide:
HeaderPayloadSignature
The next step is to submit your login request using the login token.

Copyright © 2026 Unity Technologies
법률 정보개인정보 처리방침쿠키Documentation Terms of Use개인 정보 판매 또는 공유 금지개인정보 보호 선택(쿠키 설정)

'Unity', Unity 로고 및 기타 Unity 상표는 미국 및 기타 지역 내 Unity Technologies 또는 그 계열사의 상표 또는 등록상표입니다(자세한 내용은 여기에서 확인하세요). 기타 명칭 또는 브랜드는 해당 소유자의 상표입니다.

일부 페이지는 편의를 위해 기계 번역되었으며 부정확한 내용이 있을 수 있습니다. 정보가 상충되는 경우, 영어 버전을 우선으로 참조하세요.

  • 보고 있는 페이지
    • Login token - Header

    • Login token - Payload

      • Example login token

      • Some best practices for token payloads

    • Login token - Signature


이 페이지의 문제 보고