Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active October 17, 2016 01:07
Show Gist options
  • Save kjunichi/d2fef67eb982ec6eb12c26ee36f36b64 to your computer and use it in GitHub Desktop.
Save kjunichi/d2fef67eb982ec6eb12c26ee36f36b64 to your computer and use it in GitHub Desktop.

GoでのOAuth

app-only

アクセストークン新規取得

  • 認可済みのリクエストトークン
  • 確認用コード

=>アクセストークン取得エンドポイントへリクエスト

<=

  • アクセストークン(oauth_token)
  • セッションハンドル(xoauth_yahoo_session_handle)
  • ユーザー識別子(xoauth_yahoo_guid)

アクセストークン

アクセストークン取得エンドポイント アクセストークン更新エンドポイント

Web APIのエントリーポイント

exec.LookPath

url_ := oauthClient.AuthorizationURL(requestToken, nil)
accessToken, _, err := oauthClient.RequestToken(http.DefaultClient, requestToken, stdin.Text())

参考資料

関連

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment