Polyv Help Center

Help Center

Seminar Custom Authorization

Updated: 2022-08-01 11:00:28

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.

  1. Secretkey: Used for generating the signature for verification.
  2. Custom URL: Used for the custom authorization verification API interface.

Detailed Custom Authorization Process

  1. 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.

  2. The seminar system submits parameters such as id (seminar channel ID), ts (current time in milliseconds), sign (signature for verification), and url (callback URL) 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.

  3. 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, and sign (verification signature) to the callback URL interface.

  4. 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 role
host: Host
attendee: 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

  1. Ensure the uniqueness of the userid returned by the custom verification interface. If multiple participants use the same userid to enter, the earlier logged-in participant will be kicked out by the later one.

  2. The participant's nickname must be base64 encoded first, then URL-encoded; otherwise, the nickname may display garbled characters on the viewing page.

  3. The participant's nickname cannot be empty; otherwise, the Polyv system will use the default nickname "Guest".

  4. Only one host can be logged in. The host cannot log in repeatedly.

联系客服,在线咨询