4
6

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.

WebアプリでLINEログイン(Integrated Web Login)を実装した時に、ログインエラーになるときの対処法

Last updated at Posted at 2017-05-02

結構ハマった(時間使った)ので、メモを残しておきます。

Integrated Web Login

LINEログインと呼んでいるのはこれです↓
https://developers.line.me/web-api/integrating-web-login-v2#use_apis

一部の端末ではログインできるのに、一部の端末ではログインできない?

開発していると完全に忘れてしまうんですが、LINE Loginには、 DEVELOPINGPUBLISHED の2つの状態があります。
これを PUBLISHED にする必要があります

スクリーンショット 2017-05-02 17.50.43.png

もしこれが DEVELOPING になったままで、ログインしようとすると、下記のようなURLでエラーとなります(PCでログインしようとした場合)

https://access.line.me/dialog/oauth/weblogin?response_type=code&userId=&client_id=<client id>&response_mode=&showPermissionApproval=&displayType=M&otpId=&idProvider=1&scope=&redirect_uri=<redirect url>&state=84035fa3b47f2e45d475deb09c817393&lang=ja&errorMessage=AUTHENTICATION_FAIL&errorCode=401&error=server_error

つまり、 AUTHENTICATION_FAIL , server_error ということだけがわかりますので、原因が全然わからないです。
ご注意下さい。

エラー内容が ACCOUNT_LOGIN_FAILED

URLでエラー内容が ACCOUNT_LOGIN_FAILED となっている場合、LINE Dzeveloper で設定している Redirect URL とサーバ側から指定したRedirect URLが一致していない場合があるようです。

自動ログインできないとき

下記URLにある、 State を設定していないと、自動ログインでは失敗します

https://developers.line.me/web-api/integrating-web-login-v2#guidance_to_login_screen

このときも、上記と同じく AUTHENTICATION_FAIL になったような気がしますのでご注意下さい

その他の場合

アカウント設定に、 ログイン許可 というチェックボックスがあります。もしかしたらONにするといけるかもしれません

LINEログインは、まだそれほど多くの情報が出回っておらず、エラーで検索しても全然でません。
誰かの役に立つと幸いです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?