LoginSignup
2
4

More than 3 years have passed since last update.

WebアプリへのLINEログイン実装で少しハマったところ

Posted at

WebサイトへLambda+Node.js+APIGateWayを含めて、LINEログイン機能を実装しようとした。
参考にしたサイトが
「WebアプリにLINEログイン機能を組み込む」
[URL] http://xp-cloud.jp/blog/2019/11/27/6116/

非常に分かり易くて参考になったが、一部どうしても動かない(LINE認証画面が出てこない)為、エラーメッセージを眺めてみると、「stateが無い」といったことを言われているので、あらためて、LINE公式を確認すると

"queryStringParameters": {
    "error": "invalid_request",
    "error_description": "'state' is not specified."
    },

stateというパラメータは「必須」ということだった。

20201006-1.JPG
LINE公式サイト:
https://developers.line.biz/ja/docs/line-login/integrate-line-login/#making-an-authorization-request
 
 
パラメタに「state」を足してパラメタ付きのリンクをたたくと、無事に表示されたLINEログイン画面。
20201006-2.png

その他の動作(Lamda~APIGateway)に関しては問題なく稼働。ありがとうございます作者様。

2
4
0

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
2
4