Polyv Help Center

Help Center

Channel Single Sign-On

Updated: 2022-03-17 10:03:42

Description

单点登录可以实现在登录已有系统的状态下,免登录操作进入保利威的账号、保利威的直播频道后台,做直播相关设置

Applicable Scenarios

Polyv backend single sign-on: Channel

Channel: Enter the channel backend, obtain administrator permissions for the current channel only, and manage the current channel. Suitable for channel administrator login redirection.

Important Notes

The interface domain names https://live.polyv.net (legacy live streaming backend) or https://console.polyv.net (new live streaming backend) mentioned in this document are the default domains for Polyv SaaS. If the customer has customized a CNAME, it must be modified to the corresponding CNAME domain for API calls; otherwise, the single sign-on functionality may be affected.

How to Operate

1. Operation Flow

2. API Call Description
Operation Type Set Token API (Click to view detailed API call) Single Sign-On Backend API
Channel https://api.polyv.net/live/v2/channels/{channelId}/set-token http://live.polyv.net/#/teacher/{频道号}
3. Steps
Step 1. Set Single Sign-On Token Parameters
API URL
1.根据操作类型(频道)选择对应的设置token接口URL
    频道:https://api.polyv.net/live/v2/channels/{channelId}/set-token
2.接口说明
    支持格式:JSON
    请求方式:POST
    请求数限制:TRUE
    接口URL中的{channelId}为频道号
    token 参数请勿过于简单,建议使用16位随机字符串
    支持https协议
Request Parameters
Parameter Required Type Description
appId true String Obtained from API settings, the appId registered in the live streaming system
timestamp true String Current 13-digit millisecond timestamp, valid for 3 minutes
token true String Unique string
sign true String Signature, a 32-character uppercase MD5 value
Successful Response JSON Example
{
    "code": 200,
    "status": "success",
    "message": "",
    "data": "success"
}
Failed Response JSON Example

Missing appId

{
    "code": 400,
    "status": "error",
    "message": "appId is required.",
    "data": ""
}
Response Field Description
Parameter Description
code Request status response code
status Request status
message Error message
data Returns "success" string on success
Step 2. After successfully calling the Set Token API, call the Single Sign-On Backend API to perform the authorized login operation.
API URL
1.根据操作类型(频道)选择对应的单点登录后台接口URL
    频道:https://live.polyv.net/teacher/auth-login
2.接口说明
    支持格式:JSON
    请求方式:GET
    请求数限制:TRUE
    用于获取token后授权登录直播后台
    支持https协议
Request Parameters for Channel Operation Type
Parameter Required Type Description
channelId true String Channel ID
token true String Token string set via the Channel Token API, valid for 10 seconds and for single-use verification
redirect true String Redirect URL after authorization, use URL encoding. For example, channel backend: http://live.polyv.net/#/teacher/{频道号} Note: If a CNAME is configured, replace live.polyv.net with the CNAME domain
Successful Response Example

Upon successful verification, it will redirect to the corresponding webpage. Upon failed verification, it will redirect to the channel login page.

联系客服,在线咨询
在线咨询