gem install oauth2 irb -r oauth2
site = "http://localhost:3000/"
client = OAuth2::Client.new("es", "some_secret", site: site)
url = client.auth_code.authorize_url(redirect_uri: "https://localhost:3000/accounts/auth/")
URLにアクセス。返ってきたきたcodeを取得。
code = 自分で代入
token = client.auth_code.get_token(code, redirect_uri: "https://localhost:3000/accounts/auth/")