Seminar Custom Authorization
Feature Path
我的直播 --> 频道设置 --> 参会条件设置 --> 自定义授权
Feature Description
When opening the seminar participation page, the live streaming system calls the customer system's verification interface. The customer defines the verification logic. Only after successful verification can the Polyv Seminar participation page be opened. The participant account returned by the interface must be unique, meaning the same account cannot be logged in from two locations simultaneously; the earlier logged-in account will be kicked out.
- Secretkey: Used for generating the signature for verification.
- Custom URL: Used for the custom authorization verification API interface.
Detailed Custom Authorization Process
Enter the user's authorization verification API interface in the Custom URL field. Provide a complete URL without parameters (cannot be a local server address like localhost, and must not contain a
?), e.g., http://myWebsite.com/auth.The seminar system submits parameters such as
id(seminar channel ID),ts(current time in milliseconds),sign(signature for verification), andurl(callback URL) to the user's custom API interface. The user must perform MD5 encryption on the stringparticipant secretkey + id + participant secretkey + tsand compare it with the value of thesignparameter to determine validity.After passing verification and custom validation logic, the customer system submits parameters including
userid(unique participant identifier, supports only English letters, numbers, and underscores),nickname(nickname),role(role),ts(current time in milliseconds),param4,param5, andsign(verification signature) to the callback URL interface.The seminar system verifies the signature and determines whether to allow participation/hosting. Upon successful verification, the seminar participation page is opened, and the chat area displays the participant's nickname. After one successful request, the link becomes invalid.
Submitted Parameter Description
| Parameter | Description |
|---|---|
| id | Seminar channel ID, e.g., 10000 |
| ts | Current time in milliseconds (long integer), e.g., 1466648001977 |
| sign | Signature for verification. Generation rule: MD5 encryption of the string participant secretkey + id + participant secretkey + ts |
| url | Callback URL address. After the user passes verification and processing, redirect to this URL |
The seminar system submits the above parameters to the user's custom API interface. The user must perform MD5 encryption on the string participant secretkey + id + participant secretkey + ts and compare it with the value of the sign parameter to determine validity.
Callback URL Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| 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. Case-insensitive during sign verification |
| nickname | true | String | Participant nickname, requires URL-safe base64 encoding |
| role | true | String | Seminar participant rolehost: Hostattendee: Participant |
| userid | false | String | Participant ID, must be unique (max 64 characters, supports only English letters, numbers, and underscores) |
| avatar | false | String | Participant avatar URL |
| param4 | false | String | Custom parameter for tracking participation viewing logs. Must be base64 encoded first, then URL-encoded |
| param5 | false | String | Custom parameter for tracking participation viewing logs. Must be base64 encoded first, then URL-encoded |
After passing the first verification step, the user interface must submit the above parameters to the callback URL interface. The system will verify the signature and determine whether to allow the user to participate. After one successful request, the link becomes invalid.
Notes
Ensure the uniqueness of the
useridreturned by the custom verification interface. If multiple participants use the sameuseridto enter, the earlier logged-in participant will be kicked out by the later one.The participant's nickname must be base64 encoded first, then URL-encoded; otherwise, the nickname may display garbled characters on the viewing page.
The participant's nickname cannot be empty; otherwise, the Polyv system will use the default nickname "Guest".
Only one host can be logged in. The host cannot log in repeatedly.
