## 接口说明 > 第三方系统为了要调用我们的api,而获取token的场景,使用**客户端模式** ## 接口定义 * **Header添加以下参数** ~~~ Authorization:Basic base64加密({clientId}:{clientSecret}) ~~~ > `clientId`和`clientSecret`可以在应用管理中找到 > 使用`postman`有自动生成该header参数的功能,如下图 >![](https://img.kancloud.cn/ba/51/ba5161b78507d373d52861145a11de3e_1550x596.png) ~~~[api] post:http://127.0.0.1:9999/authServer/oauth/token?grant_type=client_credentials&scope={scope} *string:scope=all#授权范围 *grant_type=client_credentials#认证方式 <<< success { "msg": "", "code": 0, "data": { "access_token": "efc0d6e6-c951-4e81-a8db-3d1085295da4", "token_type": "bearer", "refresh_token": "56709efb-24b3-452b-8d57-90d99be76242", "expires_in": 21599, "scope": "all" } } <<< error { "msg": "Invalid scope: app1", "code": 1, "data": null } <<< error { "timestamp": "2020-04-17T01:41:15.443+0000", "status": 401, "error": "Unauthorized", "message": "Unauthorized", "path": "/oauth/token" } ~~~