Giter VIP home page Giter VIP logo

agora-token-service's Introduction

Agora Token Webservice

Go Docker Image CI
Written in Golang, using Gin framework to create a RESTful webservice for generating user tokens for use with the Agora.io platform.

Agora.io Advanced Guide: Token Management

How to Run

Set the APP_ID and APP_CERT env variables.

go run main.go

Docker

#1. Open the Dokerfile and update the values for APP_ID and APP_CERT

ENV APP_ID=""
ENV APP_CERT=""

#2. To build the container:

docker build -t agora-token-service .

#3. Run the container

docker run agora-token-service

Note: for testing locally

docker run -p 8080:8080 agora-token-service

Endpoints

Ping

endpoint structure

/ping

response:

{"message":"pong"} 

RTC Token

The rtc token endpoint requires a tokentype (uid || userAccount), channelName, and the user's uid (type varies based on tokentype). (optional) Pass an integer to represent the token lifetime in seconds.

endpoint structure

/rtc/:channelName/:role/:tokentype/:uid/?expireTime

response:

{"rtcToken":" "} 

RTM Token

The rtm token endpoint requires the user's uid. (optional) Pass an integer to represent the privelege lifetime in seconds. endpoint structure

/rtm/:uid/?expireTime

response:

{"rtmToken":" "} 

Both Tokens

The rte token endpoint generates both the rtc and rtm tokens with a single request. This endpoint requires a tokentype (uid || userAccount), channelName, and the user's uid (type varies String/Int based on tokentype). (optional) Pass an integer to represent the token lifetime in seconds.

endpoint structure

/rte/:channelName/:role/:tokentype/:uid/?expireTime

response:

{
  "rtcToken":" ",
  "rtmToken":" " 
} 

agora-token-service's People

Contributors

digitallysavvy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.