{"action":"opened","issue":{"url":"https://api.github.com/repos/wwulfric/renaissance/issues/7","repository_url":"https://api.github.com/repos/wwulfric/renaissance","labels_url":"https://api.github.com/repos/wwulfric/renaissance/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/wwulfric/renaissance/issues/7/comments","events_url":"https://api.github.com/repos/wwulfric/renaissance/issues/7/events","html_url":"https://github.com/wwulfric/renaissance/issues/7","id":168820362,"number":7,"title":"oauth","user":{"login":"wwulfric","id":8315997,"avatar_url":"https://avatars.githubusercontent.com/u/8315997?v=3","gravatar_id":"","url":"https://api.github.com/users/wwulfric","html_url":"https://github.com/wwulfric","followers_url":"https://api.github.com/users/wwulfric/followers","following_url":"https://api.github.com/users/wwulfric/following{/other_user}","gists_url":"https://api.github.com/users/wwulfric/gists{/gist_id}","starred_url":"https://api.github.com/users/wwulfric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwulfric/subscriptions","organizations_url":"https://api.github.com/users/wwulfric/orgs","repos_url":"https://api.github.com/users/wwulfric/repos","events_url":"https://api.github.com/users/wwulfric/events{/privacy}","received_events_url":"https://api.github.com/users/wwulfric/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-02T07:46:14Z","updated_at":"2016-08-02T07:46:14Z","closed_at":null,"body":"```ruby\r\nrequire 'oauth2'\r\nrequire \"base64\"\r\nclient_id = '153976e8-af02-4e90-84ac-5357abf95c3f'\r\nclient_secret = '91adc63e-2ac9-4c2e-84c5-870afd4d2f3e'\r\nredirect_uri = 'http://127.0.0.1:3000/fangcloud/auth/callback'\r\nbearer = Base64.encode64(\"#{client_id}:#{client_secret}\")\r\nbearer.gsub! \"\\n\", ''\r\nclient = OAuth2::Client.new client_id, client_secret, site: 'https://oauth-server.fangcloud.net'\r\n# puts client.auth_code.authorize_url(:redirect_uri => redirect_uri)\r\ntoken = client.auth_code.get_token 'EmmQ6m',\r\n                                   redirect_uri: redirect_uri,\r\n                                   headers: {'Authorization' => \"Basic #{bearer}\"}\r\n# puts token\r\nputs \"#{client_id}:#{client_secret}\"\r\nputs bearer\r\n```\r\n\r\nhttps://github.com/intridea/omniauth-oauth2"}}
{"actor":{"display_login":"wwulfric"}}