认证与授权

认证

认证方式

Basic Authentication

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

X-Auth-Token

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

第三方认证

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

  1. POST /tokens

权限

  • 需要认证
    参数

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

响应

字段描述
token stringaccess token
user stringAuthenticatedUser