Workshop Independent Authorization
Feature Overview
When opening a workshop to join, the URL must include specified parameters. After the workshop system verifies the request is legitimate, the user will directly enter the workshop to participate/host, and the parameters passed by the user will be set as the participant's information.
Independent Authorization Process Details
After setting the channel to independent authorization, obtain the user's independent authorization participation condition
directkey(corresponding to the backend Host SecretKey or Attendee SecretKey) via the API interface.When requesting the Polyv Workshop, relevant parameters must be included, such as: https://meet.polyv.net/?channelId=2424333&ts=1628126283856&sign=6a90485fe4682c0c7621b388df2eb744&nickname=xou&role=attendee&userid=user13
The workshop system will compare the value of the
signparameter submitted by the user to determine its validity. After a successful request, the link will become invalid (sign can only be used successfully once). If valid, the workshop system will use thenicknameto enter the Polyv Workshop. If verification fails, an error page will be displayed.
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| channelId | true | Long | Channel ID |
| ts | true | Long | Current 13-digit millisecond timestamp, valid for 3 minutes |
| sign | true | String | Signature for verification. Generation rule: MD5 encryption of directKey + channelId + directKey + ts (directKey corresponds to the backend Host SecretKey or Attendee SecretKey). Sign verification is case-insensitive |
| nickname | true | String | Participant nickname, requires URL-safe base64 encoding |
| role | true | String | Workshop participation role host: Host attendee: Attendee |
| userid | false | String | Participant ID, must be unique (max length 64 characters) (only supports English uppercase/lowercase letters, numbers, and underscores) |
| avatar | false | String | URL of the participant's avatar |
| param4 | false | String | Custom parameter for tracking participation viewing logs, requires base64 encoding followed by urlencode |
| param5 | false | String | Custom parameter for tracking participation viewing logs, requires base64 encoding followed by urlencode |
Code Example (Java)
//TODO 设置为独立授权的directKey
private static final String DIRECT_SECRET_KEY = "******";
public static void main(String[] args) throws UnsupportedEncodingException, NoSuchAlgorithmException {
String url = "https://meet.polyv.net/";
//TODO 设置为独立授权的频道号
String channelId = "2424333";
String ts = String.valueOf(System.currentTimeMillis());
String nickname = URLEncoder.encode(new BASE64Encoder().encode("保利威".getBytes(StandardCharsets.UTF_8)), "GBK");
String sign = DIRECT_SECRET_KEY+channelId+DIRECT_SECRET_KEY+ts;
sign = LiveSignUtil.md5Hex(sign);
url += "?channelId="+channelId+"&ts="+ts+"&sign="+sign+"&nickname="+nickname+"&role="+role;
//浏览器直接访问url即可进入研讨会
System.out.println(url);
}
Notes
Only one host can log in; hosts cannot log in repeatedly.
If a
useridis provided, its uniqueness must be ensured. When multiple participants use the sameuseridto enter the viewing page, the earlier logged-in participant will be kicked out by the later one.
