0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

アクセストークン更新時の例外

Posted at

現在、YahooID連携サンプルコードを参考にしてアクセストークン更新を実装しましたが、
YConnectExplicit#refreshToken()にてNullPointerExceptionが発生しております。
原因の絞込みを行った所、RefreshTokenClientの実装と実際のレスポンスパラメータが食い違っておりました。
(refresh_token⇔token_type)

YConnectライブラリ使用方法の間違いなど御座いましたら教えて頂けないでしょうか。

■RefreshTokenClient#fetch()の抜粋
 String accessTokenString = jsonObject.getString("access_token");
 long expiresIn = Long.parseLong(jsonObject.getString("expires_in"));
 String refreshToken = jsonObject.getString("refresh_token");

■Tokenエンドポイント 『アクセストークン更新時のレスポンスパラメーター』の説明
 access_token  アクセストークン。APIへアクセスするのに使用します。最大1024Byte の可変長トークンです。
 token_type   アクセストークンタイプ。ウェブAPIへアクセスする際にアクセストークンを適切に用いるために必要な情報を提供します。
 expires_in   アクセストークンの有効期限を表す秒数。通常は3600(1時間)です。

■ログ抜粋
2014/10/15 14:01:04.162 [DEBUG]861:{"access_token":"<アクセストークンの文字列>","token_type":"bearer","expires_in":"3600"} (java.lang.String)

■ライブラリ
jp.co.yahoo.yconnect-2.0.0.jar
javax.json-1.0.4.jar

0
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?