Skip to content

认证与授权

认证

认证方式

Basic Authentication

curl -X POST -H "Accept:application/vnd.edusoho.v2+json" -H "Authorization: Basic dGVzdDJlZHVvc2hvOjEyMzQ1Ng==" http://demo.edusoho.com/api/tokens

X-Auth-Token

curl-X POST -H "Accept:application/vnd.edusoho.v2+json" -H "X-Auth-Token: nzGrtcsDsrFzrId2hoLYfUafskRJ0pb9" http://demo.edusoho.com/api/tokens

第三方认证

curl-X POST -H "Accept:application/vnd.edusoho.v2+json" http://demo.edusoho.com/api/tokens?access_token=access_token&openid=open_id&type=weixinweb

Access-Token

curl-X POST -H "Accept:application/vnd.edusoho.v2+json" -H "Access-Token: AccessToken" http://demo.edusoho.com/api/tokens

AccessToken等于 MD5(AppKey-SecretKey) ,AppKey和SecretKey中间符号为-

  • 新增服务器出口IP白名单校验
  • 新增API设置开关

获取X-Auth-Token

POST /tokens

权限

  • 需要认证

参数

使用 Basic Authentication 认证,需要传用户名、密码

响应

字段描述
token stringX-Auth-Token
user stringAuthenticatedUser