我现在正在使用 Github。我怎么能想得到 github 登录用户的“OAuth 令牌”。现在我有诸如 client_id、Client Secret、access_toke 之类的数据(这些所有数据仅在登录到 github 后获取)。我怎么能通过以上数据获取 OAuth 令牌。
我通过命令行获得了oauth toke,例如:
[root@localhost Dinesh]# curl -u 'DineshGK' -d '{"scopes":["repo"],"note":"Help example"}' https://api.github.com/authorizationsEnter host password for user 'DineshGK':
[root@localhost Dinesh]# curl https://api.github.com/authorizations --user "DineshGK" --data '{"scopes":["user"], "client_id":"...", "client_secret":"..."}'
Enter host password for user 'DineshGK':
{
"id": 2300973,
"url": "https://api.github.com/authorizations/2300973",
"app": {
"name": "SenchaPlayground",
"url": "http://192.168.1.56/OldPlayground/"
},
****"token": "..."**,**
"note": null,
"note_url": null,
"created_at": "2013-04-16T07:34:21Z",
"updated_at": "2013-04-16T07:34:21Z",
"scopes": [
"user"
]
}
我希望以实用的方式突出显示标记(使用 JS/PHP)..
任何人都可以帮助......提前谢谢......