781 Star 1.5K Fork 350

开源中国 / Gitee Feedback

 / 详情

使用密码方式请求access_token失败

已拒绝
需求
创建于  
2022-12-13 10:27

输入图片说明

使用2. 密码模式
用户向客户端提供邮箱地址和密码。客户端将邮箱地址和密码发给码云认证服务器,并向码云认证服务器请求令牌。( POST请求。Content-Type: application/x-www-form-urlencoded )
curl -X POST --data-urlencode "grant_type=password" --data-urlencode "username={email}" --data-urlencode "password={password}" --data-urlencode "client_id={client_id}" --data-urlencode "client_secret={client_secret}" --data-urlencode "scope=projects user_info issues notes" https://gitee.com/oauth/token

scope表示权限范围,有以下选项,请求时使用空格隔开
user_info projects pull_requests issues notes keys hook groups gists enterprises
这种方式获取access_token的时候 失败,是什么原因?是我postman写的不对吗
输入图片说明

评论 (1)

HuaweiAscend 创建了需求

检查前后空格。postman 直接导入 curl plain text 后测试正常

curl -X POST --data-urlencode "grant_type=password" --data-urlencode "username={email}" --data-urlencode "password={password}" --data-urlencode "client_id={client_id}" --data-urlencode "client_secret={client_secret}" --data-urlencode "scope=projects user_info issues notes" https://gitee.com/oauth/token

诺墨 负责人设置为诺墨
诺墨 任务状态意向 修改为已拒绝

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
551147 normalcoder 1578927376
Ruby
1
https://gitee.com/oschina/git-osc.git
git@gitee.com:oschina/git-osc.git
oschina
git-osc
Gitee Feedback

搜索帮助