3
3

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.

Scala + Play + SecureSocial でハマったエラー

Last updated at Posted at 2014-11-02

はじめに

SecureSocialを使ってSNSにログインしようとしていてハマったエラーを記録しておく。

Facebook

avator_urlが長い!

ログイン情報をMySQLにセーブしていたのだが、Facebookへのログインがうまくいかない。
エラーログを見ると、

/var/log/eb-docker/containers/eb-current-app/XXXXXXXXXXXX-stdouterr.log
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'avator_url' at row 1

という行を見つけた。

MySQLでは、avator_urlを保存するためのcolumnは以下のように宣言していた。

	CREATE TABLE user 
	(
        id INT(12) UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT,

        // 省略

        avator_url VARCHAR(200),

        // 省略

        PRIMARY KEY (id)
	) DEFAULT CHARSET=utf8 COMMENT = 'User Accounts';

200文字あれば十分じゃないのか、と思ったのだが、いちおうFacebookから返ってきているavatorのURLの文字数を数えてみたら230文字強あった…。長過ぎる…

解決策

MySQLで、avator_url を255文字に変更したらエラーはでなくなった。

        avator_url VARCHAR(255),

Google

Google Developer Console の設定がよくわからない

Googleアカウントでなかなかログインできなかった。
エラーログは以下。

/var/log/eb-docker/containers/eb-current-app/XXXXXXXXXXXX-stdouterr.log
application - [securesocial] error retrieving profile information from Google. Error code = 403, message = Access Not Configured. Please use Google Developers Console to activate the API for your project.

解決策

Please use Google Developers Console to activate the API for your project.でぐぐると以下の記事を見つけた。

Google OAuth 2.0 loginが2014年9月に使えなくなる(Googleアカウントからのユーザ登録機能がある場合は注意)

記事のとおり、Google Development ConsoleでGoogle+ APIを有効にしたらエラーはでなくなった。

3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?